Skip to content

Instantly share code, notes, and snippets.

@bcse bcse/

Created Jun 19, 2013
What would you like to do?
Remove all UTF-16 characters by regular expression
txt = u'\U0001f600'
r = re.compile(u'[\uD800-\uDBFF][\uDC00-\uDFFF]')
r.sub('', txt)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.