Repository navigation
Conversation
isEmoji checks if the string contains an emoji
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #2015 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 104 105 +1
Lines 2203 2210 +7
Branches 477 478 +1
=========================================
+ Hits 2203 2210 +7 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
This is an improvement to #1968 right? |
removed .idea folder
Yes, rather than listing all the possible emojis, the regex takes ranges of emojis. However, the regex definitely can be improved further. |
ParthJadhav
left a comment
There was a problem hiding this comment.
LGTM... Regex could be simplified. But it works great !
|
one question that comes to my mind here: I can see the latter being useful, but I can't really see any practical application for the former. |
Had a look at the other isEmoji functions. One of my initial solutions I found was to use
\p{Emoji}, however, it also accepts numbers and other symbols. There were other ones such as\p{Extended_Pictographic}but it didn't seem to work. I found that\p{Emoji_Presentation }worked but some emojis would not return true as they were considered symbols rather than an emoji, for example: ☂, ❤ , ©️, etc. Unfortunately the emoji unicode system is all over the place so I haven't been able to simplify the Regex to only accept the symbols that Emoji_Presentation cannot. Currently, the regex accepts emojis and emojis that are both symbols and emojis.Checklist