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

Is it necessary to remove Emoji_Component? #115

Open
yisibl opened this issue Sep 27, 2024 · 0 comments
Open

Is it necessary to remove Emoji_Component? #115

yisibl opened this issue Sep 27, 2024 · 0 comments

Comments

@yisibl
Copy link

yisibl commented Sep 27, 2024

const emojiRegex = require('emoji-regex');
const text = `
🦰
 🏻
`;

const regex = emojiRegex();
for (const match of text.matchAll(regex)) {
  const emoji = match[0];
  console.log(`Matched sequence ${ emoji } — code points: ${ [...emoji].length }`);
}

Output:

Matched sequence 🦰 — code points: 1
Matched sequence 🏻 — code points: 1

Technically, I don't think these are Emoji. Maybe we should add an option to exclude these.


https://www.unicode.org/Public/emoji/16.0/emoji-test.txt

# All omitted code points have Emoji_Component=No

0023          ; Emoji_Component      # E0.0   [1] (#️)       hash sign
002A          ; Emoji_Component      # E0.0   [1] (*️)       asterisk
0030..0039    ; Emoji_Component      # E0.0  [10] (0️..9️)    digit zero..digit nine
200D          ; Emoji_Component      # E0.0   [1] (‍)        zero width joiner
20E3          ; Emoji_Component      # E0.0   [1] (⃣)       combining enclosing keycap
FE0F          ; Emoji_Component      # E0.0   [1] ()        VARIATION SELECTOR-16
1F1E6..1F1FF  ; Emoji_Component      # E0.0  [26] (🇦..🇿)    regional indicator symbol letter a..regional indicator symbol letter z
1F3FB..1F3FF  ; Emoji_Component      # E1.0   [5] (🏻..🏿)    light skin tone..dark skin tone
1F9B0..1F9B3  ; Emoji_Component      # E11.0  [4] (🦰..🦳)    red hair..white hair
E0020..E007F  ; Emoji_Component      # E0.0  [96] (󠀠..󠁿)      tag space..cancel tag
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

1 participant