whFalsa / app /utils /emoji.py
codeBOKER's picture
feat: skip optional trip fields and accept natural date expressions
96f3b64
Raw
History Blame Contribute Delete
457 Bytes
import re
_EMOJI_RE = re.compile(
"["
"\U0001F600-\U0001F64F"
"\U0001F300-\U0001F5FF"
"\U0001F680-\U0001F6FF"
"\U0001F1E0-\U0001F1FF"
"\U00002702-\U000027B0"
"\U0000FE00-\U0000FE0F"
"\U0001F900-\U0001F9FF"
"\U0001FA00-\U0001FA6F"
"\U0001FA70-\U0001FAFF"
"\U00002600-\U000026FF"
"\U0000200D"
"]",
flags=re.UNICODE,
)
def count_emojis(text: str) -> int:
return len(_EMOJI_RE.findall(text or ""))