Created
November 7, 2019 07:45
-
-
Save n1n9-jp/5857d7725f3b14cbc8ec3e878e4307ce to your computer and use it in GitHub Desktop.
Python code to remove emoji
This file contains hidden or 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
# Python code to remove emoji | |
# source: http://www.unicode.org/charts/ | |
import re | |
def remove_emojis(data): | |
emoj = re.compile("[" | |
u"\U00002700-\U000027BF" # Dingbats | |
u"\U0001F600-\U0001F64F" # Emoticons | |
u"\U00002600-\U000026FF" # Miscellaneous Symbols | |
u"\U0001F300-\U0001F5FF" # Miscellaneous Symbols And Pictographs | |
u"\U0001F900-\U0001F9FF" # Supplemental Symbols and Pictographs | |
u"\U0001FA70-\U0001FAFF" # Symbols and Pictographs Extended-A | |
u"\U0001F680-\U0001F6FF" # Transport and Map Symbols | |
"]+", re.UNICODE) | |
return re.sub(emoj, '', data) | |
return remove_emojis(value) |
supplement
"𝟭▪️ 𝗢.𝗣.𝗦" ==> ▪️ ..
should add
u'[\U00010000-\U0010ffff]'
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
that's what I need. Thanks