🚀 DAY 5 OF LAUNCH WEEK: Introducing Socket Firewall Enterprise.Learn more
Socket
Book a DemoInstallSign in
Socket

emoji-regex

Package Overview
Dependencies
Maintainers
1
Versions
37
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

emoji-regex

A regular expression to match all Emoji-only symbols as per the Unicode Standard.

Source
npmnpm
Version
1.0.0
Version published
Weekly downloads
190M
-6.7%
Maintainers
1
Weekly downloads
 
Created
Source

emoji-regex Build status Code coverage status Dependency status

emoji-regex offers a regular expression to match all Emoji-only symbols 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 Yemen
flag.match(emojiRegex())[0] == flag;
// → true

Author

twitter/mathias
Mathias Bynens

License

emoji-regex is available under the MIT license.

Keywords

unicode

FAQs

Package last updated on 28 Sep 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts