node-re2 icon indicating copy to clipboard operation
node-re2 copied to clipboard

Emoji-related unicode character classes not recognized.

Open JohnXLivingston opened this issue 5 months ago • 3 comments

Hello,

It seems that following character classes are not supported by node-re2, although there are supported by Javascript RegExp: \p{Emoji}, \p{Emoji_Component}, \p{Emoji_Modifier}

See this session in the interractive node CLI:

> const RE2 = await import("re2")
undefined
> new RE2.default(/\p{Emoji}/)
Uncaught SyntaxError: invalid character class range: \p{Emoji}
> new RE2.default(/\p{Emoji_Component}/)
Uncaught SyntaxError: invalid character class range: \p{Emoji_Component}
> new RE2.default(/\p{Emoji_Modifier}/)
Uncaught SyntaxError: invalid character class range: \p{Emoji_Modifier}

> new RegExp(/\p{Emoji}/)
/\p{Emoji}/

Can't find anything about Emojis in RE2 documentation. Do you know if there is any chance to have it work in node-re2?

JohnXLivingston avatar Jun 03 '25 15:06 JohnXLivingston