Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Emoji regex don't work for not colored 👍 #159

Closed
misha-erm opened this issue Jul 14, 2023 · 3 comments
Closed

Emoji regex don't work for not colored 👍 #159

misha-erm opened this issue Jul 14, 2023 · 3 comments

Comments

@misha-erm
Copy link

Hello,

I was testing the emoji regex and noticed that it doesn't match thumbs up emoji if it doesn't have skin color

const EMOJI_REGEX = require('emojibase-regex/emoji');

console.log('Match for 👍🏻 :', '👍🏻'.match(EMOJI_REGEX)) //  ->  Match for 👍🏻 : [ '👍🏻', index: 0, input: '👍🏻', groups: undefined ]
console.log('Match for 👍 :','👍'.match(EMOJI_REGEX)) //  -> Match for 👍 : null

Here is a link to REPL https://replit.com/@MikeYermolayev/emojibase-regex-repro

Thank you

@robintown
Copy link

The issue in other words: #174

@milesj
Copy link
Owner

milesj commented Jun 9, 2024

This is a bit weird since we have tests that check all emojis: https://github.com/milesj/emojibase/blob/master/packages/regex/tests/regex.test.ts#L67

@milesj
Copy link
Owner

milesj commented Jun 9, 2024

Ok yeah, I misread the post. Yeah emoji regex requires a variant modifier, which 👍 does not have. So you want emoji-loose.

This is "working as intended" right now, but I think in the next version I'm going to remove the loose regex as it causes confusion.

@milesj milesj closed this as completed Jun 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants