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.74k stars 174 forks source link

Using regex to replace emoji characters #5

Closed perry-mitchell closed 8 years ago

perry-mitchell commented 8 years ago

When trying to use emoji-regex to replace certain characters, some data is left in the resulting string:

"❤️".replace(emojiRegex(), ' ').length; // 2

Although it will match, it doesn't appear to match the entire "string".

mathiasbynens commented 8 years ago

https://github.com/mathiasbynens/emoji-regex/issues/2#issuecomment-118503456