Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More โ†’
Socket
Sign inDemoInstall
Socket

emoji-regex

Package Overview
Dependencies
Maintainers
2
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.

  • 10.2.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
107M
decreased by-11.36%
Maintainers
2
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 29 Sep 2022

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

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with โšก๏ธ by Socket Inc