Skip to content

Instantly share code, notes, and snippets.

@Alex-Just
Alex-Just / strip_emoji.py
Last active May 27, 2024 16:44
Python regex to strip emoji from a string
import re
# http://stackoverflow.com/a/13752628/6762004
RE_EMOJI = re.compile('[\U00010000-\U0010ffff]', flags=re.UNICODE)
def strip_emoji(text):
return RE_EMOJI.sub(r'', text)
print(strip_emoji('🙄🤔'))