How would i split by emoji?
-
I have a project here, displaying a list with every single emoji:
https://play.creaticode.com/projects/68941e23be82be430b48587f
Now I want to make a table with two columns, Emoji, and Name. I need to use this list, but my issue is that I’m not sure how to make that table using this list. The main issue I’m facing is that emojis are not one character all the time. For instance, while “a” and “
” are visually one character, they actually aren’t because emojis sometimes use zero width joiners and even skin tone modifiers, for instance, when
is expanded you can see the fist and the skin tone modifier.
Is there an easy way or possible regex thing I could use to split a string like “
smiley face” into “
” and “smiley face” to put into a table?
-
@jeffreyrb03-gmail no code is connected in the code, how does it work
-
Maybe you can split each item in the list by SPACE, then the first part will be the emoji? And the rest of the item will be the name?
-
@dreamsmp_luck i’m just showing a list, which doesn’t need code. However i did use code to create the list from a string, but you can click the blocks and then its not needed to have a green flag block.
-
@info-creaticode said in How would i split by emoji?:
Maybe you can split each item in the list by SPACE, then the first part will be the emoji? And the rest of the item will be the name?
Oh wait, that is true. That should work because there’s a space after each emoji. Thank you, I didn’t see that.
-
@info-creaticode I’ve figured it out, I can just delete all words and then trim extra whitespace with regex easily. Your suggestion helped me get there, so thank you!
-
-
@info-creaticode oh that works perfect! Thank you
-
@info-creaticode oh wait, not entirely
item 8 isface with tears of joy
i’m trying out the regex still and i’ll give updates on my results
-
@info-creaticode I managed to do it
https://play.creaticode.com/projects/68941e23be82be430b48587f