A regex that matches emoji would be a really useful thing to have in the JS ecosystem! Unfortunately, between Emojibase and emoji-regex, I still haven't seen a package that actually does this. In the case of Emojibase:
emojibase-regex matches some textual characters such as '↔'.
emojibase-regex/emoji doesn't match emoji without U+FE0F, such as '✨'.
emojibase-regex/emoji-loose matches some textual characters without U+FE0E, such as '↔'.
- And the rest of the provided regexes are obviously not intended to be used for matching emoji.
What's missing is a regex that matches exactly those character sequences that are presented to users as emoji. Some characters are defined in Unicode to default to emoji presentation (see the Emoji_Presentation section), while others require U+FE0F to change their presentation mode. A correct implementation would account for both of these facts, and use a negative lookahead to avoid matching characters with U+FE0E.
A regex that matches emoji would be a really useful thing to have in the JS ecosystem! Unfortunately, between Emojibase and emoji-regex, I still haven't seen a package that actually does this. In the case of Emojibase:
emojibase-regexmatches some textual characters such as '↔'.emojibase-regex/emojidoesn't match emoji without U+FE0F, such as '✨'.emojibase-regex/emoji-loosematches some textual characters without U+FE0E, such as '↔'.What's missing is a regex that matches exactly those character sequences that are presented to users as emoji. Some characters are defined in Unicode to default to emoji presentation (see the
Emoji_Presentationsection), while others require U+FE0F to change their presentation mode. A correct implementation would account for both of these facts, and use a negative lookahead to avoid matching characters with U+FE0E.