npm

Share private packages across your team with npm Orgs, now with simplified billing via the aws marketplace!Learn more »

emoji-regex-latest

1.0.0 • Public • Published

emoji-regex Build status Code coverage status Dependency status

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.

Installation

Via npm:

npm install emoji-regex

In Node.js:

var emojiRegex = require('emoji-regex');
// 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.
 
emojiRegex().test('🆘');
// → true
emojiRegex().test('💩');
// → true
emojiRegex().test('🇺🇸');
// → true
 
var flag = '🇺🇸'; // flag for United States
flag.match(emojiRegex())[0] == flag;
// → true

Author

twitter/mathias
Mathias Bynens

License

emoji-regex is available under the MIT license.

install

npm i emoji-regex-latest

Downloadsweekly downloads

7

version

1.0.0

license

MIT

homepage

mths.be

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability