Alex-Just
12/21/2016 - 5:27 PM

Python regex to strip emoji from a string

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('🙄🤔'))