mathiasbynens / emoji-regex

A regular expression to match all Emoji-only symbols as per the Unicode Standard.
https://mths.be/emoji-regex
MIT License
1.72k stars 175 forks source link

Does not match some emoji #93

Closed kentcdodds closed 2 years ago

kentcdodds commented 2 years ago

I was trying to use this on my blog post title for a generated social image and noticed that 🛠 isn't removed:

import emojiRegex from 'emoji-regex'

function emojiStrip(string: string) {
  return string.replace(emojiRegex(), '')
}

console.log(emojiStrip('Tools without config 🛠📦')) // Tools without config 🛠
console.log(emojiStrip('Tools without config 📦')) // Tools without config 
console.log(emojiStrip('Tools without config 🛠')) // Tools without config 🛠
console.log(emojiStrip('Tools without config 📦🛠')) // Tools without config 🛠

EDIT: I've found the same issue with the race car emoji 🏎

mathiasbynens commented 2 years ago

Could you try v10.0.0?

kentcdodds commented 2 years ago

Solid 👍 That worked great. Thank you @mathiasbynens!