The problem
With Javascript, I need to check if a string is an emoji.
Should Return TRUE:
REGEX.test("") | REGEX.test("")
REGEX.test("") | REGEX.test("")
REGEX.test("️♀️") | REGEX.test("")
REGEX.test("") | REGEX.test("")
REGEX.test("") | REGEX.test("")
- The string is ONE and ONLY ONE emoji, not 2 emojis, not one emoji and some number or special character or some letter, just ONE EMOJI.
Should return FALSE:
REGEX.test("") | REGEX.test("213")
REGEX.test(" adas") | REGEX.test("$@#*///")
REGEX.test("\/..") | REGEX.test("XD")
REGEX.test(" ") | REGEX.test(":D")
REGEX.test("♥︎") | REGEX.test("✹")
- The string contains more than one emoji
- The string has letters
- The string has a special character
- The string has anything that isn't an emoji.
- Symbols can't be matched.
Maybe a path to the solution
I found this regex, which matches all the possible emotes, but I don't make any idea about how to make it fits in my case.