emoji-regex offers a regular expression to match all emoji symbols (including textual representations of emoji) as per the Unicode Standard.
This repository contains a script that generates this regular expression based on the data from Unicode Technical Report #51. Because of this, the regular expression can easily be updated whenever new emoji are added to the Unicode standard.
npm install emoji-regex
var emojiRegex = ;// Note: because the regular expression has the global flag set, this module// exports a function that returns the regex rather than exporting the regular// expression itself, to make it impossible to (accidentally) mutate the// original regular expression.;// → true;// → true;// → truevar flag = '🇺🇸'; // flag for United Statesflag0 == flag;// → true
emoji-regex is available under the MIT license.