mathiasbynens / emoji-regex

A regular expression to match all Emoji-only symbols as per the Unicode Standard.
https://mths.be/emoji-regex
MIT License
1.72k stars 175 forks source link

Doesn't match flags like this one 🏴󠁵󠁳󠁴󠁸󠁿 #70

Closed jcubic closed 3 years ago

jcubic commented 3 years ago

When using match on flag it return default empty flag "🏴".

mathiasbynens commented 3 years ago

Seems to work for me:

$ npm install emoji-regex
$ node -p "require('emoji-regex')().exec('\u{1F3F4}')"
[ '🏴', index: 0, input: '🏴', groups: undefined ]

Closing until more info is provided. Please provide reproduction steps.

jcubic commented 3 years ago

Maybe this is bug in dev tools because if you type ['🏴󠁵󠁳󠁴󠁸󠁿'] in console it return the same flag, but if you call '🏴󠁵󠁳󠁴󠁸󠁿'.match(re()) it returns ["🏴"]. Not sure how to test if the flag is the same.