emoji-regex 
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 v12. Because of this, the regular expression can easily be updated whenever new emoji are added to the Unicode standard.
Installation
Via npm:
1 | npm install emoji-regex |
In Node.js:
1 | const emojiRegex = require('emoji-regex'); |
Console output:
1 | Matched sequence β β code points: 1 |
To match emoji in their textual representation as well (i.e. emoji that are not Emoji_Presentation symbols and that arenβt forced to render as emoji by a variation selector), require the other regex:
1 | const emojiRegex = require('emoji-regex/text.js'); |
Additionally, in environments which support ES2015 Unicode escapes, you may require ES2015-style versions of the regexes:
1 | const emojiRegex = require('emoji-regex/es2015/index.js'); |
Author
| Mathias Bynens |
License
emoji-regex is available under the MIT license.