Created
June 22, 2023 13:59
-
-
Save censuradho/fdb272e1448a5adbd9559d79ff222f7d to your computer and use it in GitHub Desktop.
function to only accept emojis, pass a string as the first parameter and it returns an array of found emojis
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * getEmojisFromString('This 😃 is an Emoji exemple ❤️') // ['😃', '❤️'] | |
| */ | |
| function getEmojisFromString (str: string) { | |
| return str.match(/\p{Emoji}+/gu) | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment