Keyboard shortcuts

Press ← or β†’ to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Character classes and Unicode characters

import re

text = "πŸ‘·πŸ‘ΈπŸ‘ΉπŸ‘ΊπŸ‘»βœπŸ‘ΌπŸ‘½πŸ‘ΎπŸ‘ΏπŸ’€πŸ’πŸ’‚"

print(text)
#print(chr(128120))
#print(0x1f000)

match = re.search(r"[\U0001f000-\U00020000]+", text)
if match:
    print(match.group(0))

for emoji in text:
    print(emoji, ord(emoji), "{:x}".format(ord(emoji)))

match = re.search(r"[πŸ‘·-πŸ’‚]*", text)
print(match.group(0))