Created
June 19, 2013 19:57
-
-
Save bcse/5817497 to your computer and use it in GitHub Desktop.
Remove all UTF-16 characters by regular expression
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
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