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

Create group #20

Closed Lisennk closed 7 years ago

Lisennk commented 7 years ago

Create regexp group to act like this:

`хуйня😏`.replace(emojiRegex(), " - $1 - ");
mathiasbynens commented 7 years ago

In this scenario, why wouldn’t you use $& instead?

`хуйня\u{1F60F}`.replace(emojiRegex(), ' - $& - ');
// → 'хуйня - 😏 - '
Lisennk commented 7 years ago

Yeah, thanks