DEV Community

Discussion on: How to caculate emoji length?

Collapse
 
patarapolw profile image
Pacharapol Withayasakpunt • Edited

I would runes2, but it doesn't hide the reality than beyond UTF-8 is complex.

If you just want to match unicode symbols, a better and non-cryptic idea, is to use XRegExp. For other symbols, it is XRegExp('\\p{So}').