Skip to content

Instantly share code, notes, and snippets.

@listochkin
Created December 1, 2021 10:43
Show Gist options
  • Save listochkin/cfcf618e72f6e83f0cee2704927e41b2 to your computer and use it in GitHub Desktop.
Save listochkin/cfcf618e72f6e83f0cee2704927e41b2 to your computer and use it in GitHub Desktop.
Emoji Regular Expression for JavaScript
// adapted from https://unicode.org/reports/tr51/#EBNF_and_Regex
export const emojiRegex =
/(?<emoji>\p{RI}\p{RI}|\p{Emoji}(\p{EMod}|\uFE0F\u20E3?|[\uE0020-\uE007E]+\uE007F)?(\u200D\p{Emoji}(\p{EMod}|\uFE0F\u20E3?|[\uE0020-\uE007E]+\uE007F)?)*)/u;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment