Socket
Socket
Sign inDemoInstall

emoji-regex

Package Overview
Dependencies
Maintainers
1
Versions
35
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.


Version published
Weekly downloads
112M
decreased by-0.46%
Maintainers
1
Weekly downloads
 
Created

What is emoji-regex?

The emoji-regex npm package provides a regular expression to match all Emoji-only symbols as per the Unicode Standard. This package is useful for processing text that contains emojis, allowing developers to identify, validate, or manipulate emojis within strings.

What are emoji-regex's main functionalities?

Matching emojis in a string

This code sample demonstrates how to use emoji-regex to find all emojis in a given string. The regex is executed against a string containing emojis, and it will match each emoji character or sequence.

/(emojiRegex())/g.exec('I ❤️ emoji!')

Replacing emojis in a string

This code sample shows how to replace all emojis in a string with a specific word or character. In this case, every emoji in the string is replaced with the word 'emoji'.

'I ❤️ emoji!'.replace(emojiRegex(), 'emoji')

Counting emojis in a string

This code sample is used to count the number of emojis in a string. The match function returns an array of all emojis found, and the length property of the array indicates the total number of emojis.

'👍👍🏿'.match(emojiRegex()).length

Other packages similar to emoji-regex

Keywords

FAQs

Package last updated on 10 Apr 2020

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc