# emoji-regex — card for AI agents

Regular expression to match all emoji symbols per Unicode Standard.

Category: Utilities · npm package `emoji-regex` · latest version 11.0.0 (checked 2026-11-01)
Install: `npm install emoji-regex`
License: MIT (permissive)

In your own product (generator, app, hosted service): **yes**. Permissive license: ship it inside your own product, closed or open source, and keep its license and copyright notice.

## Numbers (AgentGid data)
- Gid Score: 61.7 (#906 of all tools, 107 of 408 in its category)
- Used in 2 public projects set up for AI coding agents (0.0%)
- Downloads last week: 612,019,069 (as of 2026-11-24), +38.5% over 4 weeks
- GitHub stars: 1,909 (as of 2026-11-24)
- Last push: 2026-09-15

## Often used with
chalk 93.1%, Axios 86.2%, lru-cache 86.2%, ws 86.2%, execa 84.5%, https-proxy-agent 84.5%

## Links
- AgentGid page: https://agentgid.com/tools/emoji-regex/
- Homepage: https://mths.be/emoji-regex
- Repository: https://github.com/mathiasbynens/emoji-regex


## emoji-regex: find every emoji in a piece of text

emoji-regex is a free JavaScript helper that finds every emoji in a text, including emoji built from several parts, like skin tones, families and flags. Your site or app can count emoji, remove them, or swap each one for your own picture. Each release follows the newest Unicode emoji list of its day, so update it when new emoji come out.

### Where to use it
- Find and count emoji in messages: A chat, comment box or review form finds the emoji in what people type, for example to count them or show them in a list.
- Swap emoji for your own pictures: Show every emoji in your app's own emoji art, so it looks the same on every phone and computer.
- Keep skin tones and families whole: An emoji with a skin tone, a family or a flag is several characters inside, but it is found as one emoji.
- Strip emoji from names and links: Remove emoji from a username, a file name or a page address before you save it, and keep the words. (idea, not from the official pages)
- Big emoji for emoji-only messages: When a message is only emoji, like a party popper twice, show it larger, the way many chat apps do. (idea, not from the official pages)
- Limit emoji in profile names: Allow at most two emoji in a display name or a product title, and ask the person to shorten it otherwise. (idea, not from the official pages)

### How to start
- Add the package to your JavaScript project.

```
npm install emoji-regex
```

- Import it and call it to get a fresh regular expression, then loop over the matches.

```
import emojiRegex from 'emoji-regex';
const regex = emojiRegex();
for (const match of text.matchAll(regex)) {
	const emoji = match[0];
	console.log(`Matched sequence ${emoji} — code points: ${[...emoji].length}`);
}
```


### License
Free to use, also in paid products, under the MIT license. Keep its copyright and license notice in copies of the code you ship.

### Good to know
- It only finds emoji. It has no emoji pictures, names or search; pair it with an emoji set or an emoji data library.
- It also finds signs like © and ™ that can show as emoji. Removing all matches removes those signs too.
- Version 11.0.0 came out on 2026-09-15 and is built from the Unicode 18.0 emoji data. Older versions miss newer emoji.
- If you do not need the exact same results on every version, the README points to a smaller general pattern, emoji-regex-xs, that is used the same way.

Checked 2026-11-10 against: https://github.com/mathiasbynens/emoji-regex/blob/main/README.md, https://github.com/mathiasbynens/emoji-regex/blob/main/LICENSE-MIT.txt, https://github.com/mathiasbynens/emoji-regex/blob/main/package.json, https://github.com/mathiasbynens/emoji-regex/blob/v11.0.0/package.json, https://github.com/mathiasbynens/emoji-regex/blob/v10.6.0/README.md, https://github.com/mathiasbynens/emoji-regex/blob/v10.6.0/package.json, https://registry.npmjs.org/emoji-regex/11.0.0, https://registry.npmjs.org/emoji-regex

### Mistakes to avoid
- Don't: const re = emojiRegex(); then re.test(a), re.test(b) ... with the same object → Do: Call emojiRegex() for each test, or use s.match(...) / s.matchAll(emojiRegex()) (The regex has the g flag, so test() moves lastIndex; in our run the same object gave true, then false for the same rocket emoji.)
- Don't: const emojiRegex = require('emoji-regex'); copied from older guides → Do: import emojiRegex from 'emoji-regex'; or pin emoji-regex@10.6.0 if the project must stay on CommonJS (10.6.0 shipped index.js for require and its README used require; 11.0.0 ships only index.mjs and the README switched to import.)
- Don't: s.replace(emojiRegex(), '') to clean a company name or legal text → Do: Skip © ® ™ and similar signs yourself, or only strip matches that contain the emoji style marker U+FE0F (Text-style signs count as emoji; in our run "© 2026 Acme™" became "2026 Acme".)
- Don't: Counting emoji with text.length or [...text].length → Do: Count the matches of text.matchAll(emojiRegex()) (One emoji can be several code points; in our run "Ship it 🚀🚀 thanks 👩🏿‍💻!" had length 28 and 3 emoji.)
- Don't: Keeping an old emoji-regex version for years → Do: Update it after each new Unicode emoji release (11.0.0 follows Unicode 18.0) (Each version only knows the emoji of its Unicode release.)

### Questions
- Why is it a function and not a ready regular expression? The pattern has the global flag, so each call returns a fresh copy that your code cannot change by accident.
- Does a skin-tone emoji count as one or two? As one match, even though it is two code points inside.
- Can I use it in a paid product? Yes, it is under the MIT license.
- Will it find emoji added after its release? No. Each version follows the Unicode release of its day; update the package when new emoji come out.

---
AgentGid's catalog is curated: every entry was checked against the maker's official pages (registry, repository, license and pricing pages) on the date shown; a license value shows the quote it stands on wherever AgentGid has one. Usage numbers come from AgentGid's own scan of public repositories set up for AI coding agents. Claims by makers are reported, not tested by AgentGid.
