fork download
  1. import re
  2. text = 'Wow.. :smiley_face: this is delicious!' # A string containing emoji
  3. print( re.sub(r'(:[a-z_]+:)|[^\w\s]|_', r'\1', text) )
  4.  
Success #stdin #stdout 0.02s 9724KB
stdin
Standard input is empty
stdout
Wow :smiley_face: this is delicious