Created
March 28, 2017 07:13
-
-
Save leafsummer/8ef9f2ea06086d64a3246588b00632db to your computer and use it in GitHub Desktop.
remove the emoji string
From http://stackoverflow.com/questions/33404752/removing-emojis-from-a-string-in-python
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import re | |
text = u'This dog \U0001f602' | |
print(text) # with emoji | |
emoji_pattern = re.compile("[" | |
u"\U0001F600-\U0001F64F" # emoticons | |
u"\U0001F300-\U0001F5FF" # symbols & pictographs | |
u"\U0001F680-\U0001F6FF" # transport & map symbols | |
u"\U0001F1E0-\U0001F1FF" # flags (iOS) | |
"]+", flags=re.UNICODE) | |
print(emoji_pattern.sub(r'', text)) # no emoji |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment