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

How to use emoji-regex v10.0.0 with regexp unicode flag #94

Closed curly210102 closed 2 years ago

curly210102 commented 2 years ago

Hello, dear developer,

I've met one problem using emoji-regex v10.0.0 with unicode flag, I tried to concat emoji regex source with other regex string, then create a new RegExp instance with unicode mode. It works well with "emoji-regex/es2015/RGI_Emoji" in v9.2.2. But upgrade to v10.0.0, the module have been canceled.

Are there any recommanded way to use unicode mode with emoji-regex v10.0.0?

Thanks for help.

mathiasbynens commented 2 years ago

You’ll want to use https://github.com/mathiasbynens/emoji-test-regex-pattern/blob/main/dist/latest/javascript-u.txt rather than https://github.com/mathiasbynens/emoji-test-regex-pattern/blob/main/dist/latest/javascript.txt (which is what emoji-regex uses).

curly210102 commented 2 years ago

Great, it fully meet needs.

Thanks for support. 👍