Basically what I want to do is to match only strings that contain emojis and no other characters. It could have one or many emojis as long as there are no other characters.
I know there has been questions like it in the past but none of them supports all emojis.
I'm using the following to detect emojis but am unsure how to exclude other characters from it.
const regex = /\p{Extended_Pictographic}/ug
return regex.test(mystr);
These are my test cases and the expected results:
d❤️f -> false
t -> false
3 -> false
-> true
❤️ -> true
-> true
♂️ -> true
-> true
-> true
You may test the result here: https://regex101.com/r/krwZ7W/1