{
 "kind": "tool",
 "slug": "emoji-regex",
 "path": "tools/emoji-regex/",
 "name": "emoji-regex",
 "maker": null,
 "density": "full",
 "crumbs": [
  [
   "Tools",
   "tools/"
  ],
  [
   "Utilities",
   "tools/utilities/"
  ]
 ],
 "lead": "Find every emoji in a piece of text.",
 "chips": [
  {
   "label": "Utilities",
   "path": "tools/utilities/"
  },
  {
   "label": "NPM"
  }
 ],
 "primary": {
  "label": "Copy install command",
  "copy": "npm install emoji-regex"
 },
 "links": [
  {
   "label": "GitHub",
   "href": "https://github.com/mathiasbynens/emoji-regex"
  },
  {
   "label": "Website",
   "href": "https://mths.be/emoji-regex"
  }
 ],
 "track": "New versions, deprecation and license changes on your dashboard",
 "verdicts": [
  {
   "key": "license",
   "label": "License",
   "value": "MIT",
   "status": "yes",
   "sub": "Use it in paid apps",
   "quote": "Permission is hereby granted, free of charge, to any person obtaining a copy of this software",
   "note": "MIT allows commercial use; keep the copyright and license notice with the code.",
   "src": "https://github.com/mathiasbynens/emoji-regex/blob/main/LICENSE-MIT.txt"
  },
  {
   "key": "maint",
   "label": "Maintained",
   "value": "Maintained",
   "status": "yes",
   "sub": "Last change Sep 15, 2026",
   "note": "",
   "src": "https://github.com/mathiasbynens/emoji-regex"
  },
  {
   "key": "pop",
   "label": "Used by agents' projects",
   "value": "2 projects",
   "status": "info",
   "sub": "#242 of 408 in its category",
   "note": "Dependency in 2 public GitHub projects set up for AI coding agents that we scanned (0.0%).",
   "src": null
  },
  {
   "key": "agent",
   "label": "Agent access",
   "value": "Install only",
   "status": "info",
   "sub": null,
   "note": "Agent skills for this library in the skills catalog; community skills are written by others, read them before you install.",
   "src": null
  }
 ],
 "vfoot": "From the package registry and GitHub, checked daily; card checked Nov 10, 2026.",
 "blocks": [
  {
   "id": "overview",
   "nav": "Overview",
   "h2": "What emoji-regex does",
   "parts": [
    {
     "t": "prose",
     "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."
    },
    {
     "t": "h3",
     "text": "What people build with it"
    },
    {
     "t": "uses",
     "items": [
      {
       "title": "Find and count emoji in messages",
       "text": "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.",
       "idea": false
      },
      {
       "title": "Swap emoji for your own pictures",
       "text": "Show every emoji in your app's own emoji art, so it looks the same on every phone and computer.",
       "idea": false
      },
      {
       "title": "Keep skin tones and families whole",
       "text": "An emoji with a skin tone, a family or a flag is several characters inside, but it is found as one emoji.",
       "idea": false
      },
      {
       "title": "Strip emoji from names and links",
       "text": "Remove emoji from a username, a file name or a page address before you save it, and keep the words.",
       "idea": true
      },
      {
       "title": "Big emoji for emoji-only messages",
       "text": "When a message is only emoji, like a party popper twice, show it larger, the way many chat apps do.",
       "idea": true
      },
      {
       "title": "Limit emoji in profile names",
       "text": "Allow at most two emoji in a display name or a product title, and ask the person to shorten it otherwise.",
       "idea": true
      }
     ]
    }
   ]
  },
  {
   "id": "popularity",
   "nav": "Popularity",
   "h2": "emoji-regex popularity",
   "parts": [
    {
     "t": "stats",
     "items": [
      {
       "n": "62",
       "of": "/ 100",
       "l": "Gid Score, #906 overall"
      },
      {
       "n": "612M",
       "l": "downloads a week, npm"
      },
      {
       "n": "1,909",
       "l": "GitHub stars"
      },
      {
       "n": "2",
       "l": "agent projects use it"
      }
     ]
    },
    {
     "t": "small",
     "text": "Gid Score measures public popularity and activity, not quality.",
     "link": "How the Gid Score is calculated",
     "path": "tools/top/"
    }
   ]
  },
  {
   "id": "usage",
   "nav": "How it is used",
   "h2": "How emoji-regex is used",
   "parts": [
    {
     "t": "list",
     "items": [
      "emoji-regex is a dependency in 2 of the 6,258 public GitHub projects set up for AI coding agents that we scanned, too few to describe it from them alone. Our scan also samples projects by dependency (Solana 3,067, Ethereum and EVM 1,774, 3D and games 3,130, agent frameworks and SDKs 13,750); counting those, it appears in 58 projects, and what it is used with below comes from all of them.",
      "Projects that use it most often also use chalk (93.1%), Axios (86.2%), lru-cache (86.2%)."
     ]
    },
    {
     "t": "h3",
     "text": "Often used with"
    },
    {
     "t": "rows",
     "rows": [
      {
       "l": "In 93.1% of its projects",
       "v": "chalk",
       "path": "tools/chalk/"
      },
      {
       "l": "In 86.2% of its projects",
       "v": "Axios",
       "path": "tools/axios/"
      },
      {
       "l": "In 86.2% of its projects",
       "v": "lru-cache",
       "path": "tools/lru-cache/"
      },
      {
       "l": "In 86.2% of its projects",
       "v": "ws",
       "path": "tools/ws/"
      },
      {
       "l": "In 84.5% of its projects",
       "v": "execa",
       "path": "tools/execa/"
      },
      {
       "l": "In 84.5% of its projects",
       "v": "https-proxy-agent",
       "path": "tools/https-proxy-agent/"
      },
      {
       "l": "In 84.5% of its projects",
       "v": "semver (JavaScript)",
       "path": "tools/semver-npm/"
      }
     ]
    }
   ]
  },
  {
   "id": "more",
   "nav": null,
   "spy_as": "usage",
   "h2": "More about emoji-regex",
   "parts": [
    {
     "t": "more",
     "items": [
      {
       "title": "More in Utilities",
       "path": "tools/utilities/",
       "items": [
        {
         "text": "clsx",
         "path": "tools/clsx/"
        },
        {
         "text": "date-fns",
         "path": "tools/date-fns/"
        },
        {
         "text": "PyYAML",
         "path": "tools/pyyaml/"
        },
        {
         "text": "uuid",
         "path": "tools/uuid/"
        },
        {
         "text": "yaml",
         "path": "tools/yaml/"
        },
        {
         "text": "js-yaml",
         "path": "tools/js-yaml/"
        },
        {
         "text": "glob",
         "path": "tools/glob/"
        },
        {
         "text": "Lodash",
         "path": "tools/lodash/"
        }
       ]
      }
     ]
    }
   ]
  },
  {
   "id": "alternatives",
   "nav": "Alternatives",
   "h2": "Alternatives",
   "parts": [
    {
     "t": "alts",
     "items": [
      {
       "name": "emoji-regex",
       "me": true,
       "facts": [
        "MIT",
        "Gid 62",
        "612M/wk"
       ]
      },
      {
       "name": "emoji",
       "why": "Pick the emoji library when your code is Python rather than JavaScript.",
       "path": "tools/emoji/",
       "facts": []
      }
     ],
     "more": "Compare emoji-regex with another tool",
     "more_path": "tools/compare/"
    }
   ]
  },
  {
   "id": "start",
   "nav": "Get started",
   "h2": "Get started",
   "parts": [
    {
     "t": "prompt",
     "text": "Use the npm package emoji-regex (pin emoji-regex@11.0.0, import it as an ES module) to find, count or remove emoji in user text; call emojiRegex() for each new search instead of reusing one regex with .test()."
    },
    {
     "t": "steps",
     "items": [
      {
       "text": "Add the package to your JavaScript project.",
       "code": "npm install emoji-regex",
       "src": "https://github.com/mathiasbynens/emoji-regex/blob/main/README.md"
      },
      {
       "text": "Import it and call it to get a fresh regular expression, then loop over the matches.",
       "code": "import emojiRegex from 'emoji-regex';\nconst regex = emojiRegex();\nfor (const match of text.matchAll(regex)) {\n\tconst emoji = match[0];\n\tconsole.log(`Matched sequence ${emoji} — code points: ${[...emoji].length}`);\n}\n",
       "src": "https://github.com/mathiasbynens/emoji-regex/blob/main/README.md"
      }
     ]
    },
    {
     "t": "h3",
     "text": "Mistakes to avoid"
    },
    {
     "t": "mistakes",
     "items": [
      {
       "dont": "const re = emojiRegex(); then re.test(a), re.test(b) ... with the same object",
       "fix": "Call emojiRegex() for each test, or use s.match(...) / s.matchAll(emojiRegex())",
       "why": "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."
      },
      {
       "dont": "const emojiRegex = require('emoji-regex'); copied from older guides",
       "fix": "import emojiRegex from 'emoji-regex'; or pin emoji-regex@10.6.0 if the project must stay on CommonJS",
       "why": "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."
      },
      {
       "dont": "s.replace(emojiRegex(), '') to clean a company name or legal text",
       "fix": "Skip © ® ™ and similar signs yourself, or only strip matches that contain the emoji style marker U+FE0F",
       "why": "Text-style signs count as emoji; in our run \"© 2026 Acme™\" became \"2026 Acme\"."
      },
      {
       "dont": "Counting emoji with text.length or [...text].length",
       "fix": "Count the matches of text.matchAll(emojiRegex())",
       "why": "One emoji can be several code points; in our run \"Ship it 🚀🚀 thanks 👩🏿‍💻!\" had length 28 and 3 emoji."
      },
      {
       "dont": "Keeping an old emoji-regex version for years",
       "fix": "Update it after each new Unicode emoji release (11.0.0 follows Unicode 18.0)",
       "why": "Each version only knows the emoji of its Unicode release."
      }
     ]
    }
   ]
  },
  {
   "id": "faq",
   "nav": "Questions",
   "h2": "Questions",
   "parts": [
    {
     "t": "faq",
     "items": [
      {
       "q": "Why is it a function and not a ready regular expression?",
       "a": "The pattern has the global flag, so each call returns a fresh copy that your code cannot change by accident.",
       "evidence": {
        "url": "https://github.com/mathiasbynens/emoji-regex/blob/main/README.md",
        "quote": "because the regular expression has the global flag set, this module"
       }
      },
      {
       "q": "Does a skin-tone emoji count as one or two?",
       "a": "As one match, even though it is two code points inside.",
       "evidence": {
        "url": "https://github.com/mathiasbynens/emoji-regex/blob/main/README.md",
        "quote": "emoji modifier base followed by a modifier"
       }
      },
      {
       "q": "Can I use it in a paid product?",
       "a": "Yes, it is under the MIT license.",
       "evidence": {
        "url": "https://github.com/mathiasbynens/emoji-regex/blob/main/README.md",
        "quote": "emoji-regex is available under the MIT license."
       }
      },
      {
       "q": "Will it find emoji added after its release?",
       "a": "No. Each version follows the Unicode release of its day; update the package when new emoji come out.",
       "evidence": {
        "url": "https://github.com/mathiasbynens/emoji-regex/blob/main/README.md",
        "quote": "Since each version of emoji-regex is tied to the latest Unicode version at the time of release, results are deterministic."
       }
      }
     ]
    }
   ]
  }
 ],
 "glance": [
  [
   "Package",
   "npm emoji-regex"
  ],
  [
   "Category",
   "Utilities"
  ],
  [
   "License",
   "MIT"
  ],
  [
   "Gid Score",
   "61.7"
  ],
  [
   "Rank in category",
   "#242 of 408"
  ],
  [
   "GitHub",
   "mathiasbynens/emoji-regex"
  ],
  [
   "Last change",
   "Sep 15, 2026"
  ]
 ],
 "good": [
  "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."
 ],
 "checked_line": "Read by AgentGid from 8 official pages, card checked Nov 10, 2026; numbers update daily.",
 "logo": "https://agentgid.com/media/avatars/mathiasbynens.png"
}