Skip to content

Instantly share code, notes, and snippets.

@bckim92
Created February 21, 2019 05:49
Show Gist options
  • Save bckim92/44dba637c8564571d2b3098dc043d670 to your computer and use it in GitHub Desktop.
Save bckim92/44dba637c8564571d2b3098dc043d670 to your computer and use it in GitHub Desktop.
import re
try:
# UCS-4
EMOTICON = re.compile(u'(([\U00002600-\U000027BF])|([\U0001f300-\U0001f64F])|([\U0001f680-\U0001f6FF]))')
except Exception, e:
# UCS-2
EMOTICON = re.compile(u'(([\u2600-\u27BF])|([\uD83C][\uDF00-\uDFFF])|([\uD83D][\uDC00-\uDE4F])|([\uD83D][\uDE80-\uDEFF]))')
NOT_EMOTICON = re.compile(r'(\\U([0-9A-Fa-f]){8})|(\\u([0-9A-Fa-f]){4})')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment