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

Certain emoji sequences are not recognized #87

Closed rfgamaral closed 2 years ago

rfgamaral commented 3 years ago

I've created a CodeSandbox to better demonstrate the problem:

If you get a blank page after loading, just click the CodeSandbox refresh button:

image

The problem is copying/pasting the infinity emoji from Emojipedia results in a detected emoji, however, copying/pasting the infinity emoji from Emooooji does not detect the emoji.

The same thing happens if you input the infinity emoji through the Windows 10 Emoji Panel, the emoji is not detected.

Using emoji-regex/es2015/text.js instead of emoji-regex/es2015/RGI_Emoji.js detects the infinity emoji in all scenarios, but this regex catches more than I'd like, and I can't use it.

Is this something that can/should be fixed on this regex? Or is this something that Emooooji/Windows 10 should fix themselves?

koculu commented 3 years ago

Below emoji also does not match the RGI_Emoji regex. And text.js regex is problematic. Matches non-emoji character sequences. 🌀 mostly_sunny unified : "1F324-FE0F", non_qualified : "1F324",

0xdevalias commented 3 years ago

https://github.com/mathiasbynens/emoji-regex/issues/88 seems like the same root issue as this for the πŸ› (shopping bag) emoji

BrodaNoel commented 3 years ago

Clearly it's not covering the new emojis in the last iOS version. ⚾️ is not covered in my end.

I forked this repo and I tried to add that ball in the unit tests, but I couldn't find a simple way to add it to the unit tests.

If you can prepare the unit tests suite to receive an array of emojis, in order to test if they are covered with the different functions, will be nice, so we can add new emojis as soon as we see that some of them are not covered.

n3a9 commented 3 years ago

I tried some various emoji and came up with a list of emojis that aren't matched with emoji-regex in case its helpful

mathiasbynens commented 2 years ago

Please try v10.0.0 and report back.

koculu commented 2 years ago

Please try v10.0.0 and report back.

Tested for 🌀 and it works now. I don't have a list for other mismatches but I'm sure this will cover more emoji sequences. Thank you.

mathiasbynens commented 2 years ago

Thanks for letting me know!

n3a9 commented 2 years ago

Yes, just confirmed that all emojis are now working. Thanks so much!