emojis = re.compile('(%s)' % '|'.join(map(re.escape, codes)))
search = 'string to check \U0001f601'
found = emojis.findall(search)
print(found)
How to build a regular vocabulary of emoticons in python?