Last active
August 22, 2018 12:52
-
-
Save weallwegot/b9c2d0e1a7f28e3dc0a54e42ce849964 to your computer and use it in GitHub Desktop.
Detecting emoji presence in raw text with regular expressions.
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
import re | |
all_text = "ππΎππΎππΎπ π€ π©π©π©" | |
txt_utf_8 = all_text.decode('utf-8') | |
re.findall(ur'(\ud838[\udc50-\udfff])|([\ud839-\ud83d][\udc00-\udfff])|\ | |
(\ud83e[\udc00-\udfbf])|([\udc50-\udfff]\ud838)|\ | |
([\udc00-\udfff][\ud839-\ud83d])|([\udc00-\udfbf]\ud83e)'\ | |
,txt_utf_8) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment