5

Yes, I know that this is a duplicate of a few existing questions. I have already fully acknowledged this with references in my original question introduction.

However, in 2019, the list is expanded to include additional set of 230 emojis, which I presume aren't covered in existing answers / ranges.

http://www.unicode.org/Public/emoji/12.0/

I am not exactly familiar nor comfortable constructing unicode ranges for removal, so if anyone knows can you post an updated version?

As per my understanding, the codes are a bit scattered around and cannot be easily defined from start to end in one single continuous range.


The best answer so far updated in 2018 here:

https://stackoverflow.com/a/41543705/2715309

text.replace(/([\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g, '');

As you can see, I also posted a comment about updated list, but the author hasn't updated answer yet.


additional similar questions:

jquery remove all emoji include new

Remove Emoji's from jquery

PHP : writing a simple removeEmoji function

21
  • 1
    I'd be less concerned about the unicode ranges which are relatively easy, and more concerned with enforcing consistent character encodings so that your strings in JavaScript actually contain what you expect and don't have broken surrogate pairs. Commented Mar 2, 2019 at 1:49
  • 2
    Possible duplicate of How to detect emoji using javascript Commented Mar 2, 2019 at 1:50
  • 1
    One of the answers to the dupe question suggests a library that can update itself with the modified unicode standards.. Also, ~if~ when new ranges are added, you can just update your copy of the library, instead of having to ask here again. ;) Commented Mar 2, 2019 at 1:51
  • 2
    GolesTrol, obviously I already posted this in my original question with best questions/answers already linked. Please, read before downvoting a question more carefully. Thank you Commented Mar 2, 2019 at 1:52
  • 2
    @dev101 You did not refer to the question I linked anywhere in your question. The question I linked to has a working answer, which I emphasized with the comment. Please read the comment before complaining about it. Commented Mar 2, 2019 at 1:55

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.