in reply to Regex For Removing Emoji

> found on stack overflow

Where this?

Did you ask there? Does it mean you are cross posting now?

>  and I couldn't get any of these to work.

what does this mean?

Could you provide sample input to test?

Personally I would restrict with a positive filter (white listing)

what does it help to block emojis and allow arbitrary Unicode to appear?

Cheers Rolf
(addicted to the Perl Programming Language and ☆☆☆☆ :)
Je suis Charlie!

Replies are listed 'Best First'.
Re^2: Regex For Removing Emoji
by Beaker (Beadle) on Nov 12, 2016 at 14:18 UTC
    Sample input 🦂 🍷✨⛓ 🔪🐷 ⏳🎣 Shows full color icons in firefox and chrome, white only in IE and some of the icons in Safari, also white only.
      Better dump the $text your application handles, before and after applying the regexes.

      I suspect the data you are processing doesn't look like it is supposed to do. (Probably Html escaped)

      Anyway, in general providing us with a complete test script showing input and output would help you and us.

      Often errors are spotted by the authors when preparing a post like this.

      Cheers Rolf
      (addicted to the Perl Programming Language and ☆☆☆☆ :)
      Je suis Charlie!

      Fwiw, for those interested the monastery transforms the provided emojis 🍷✨⛓ 🔪🐷 ⏳🎣 into 🍷✨⛓ 🔪🐷 ⏳🎣  within code blocks

        Thanks, I didn't realise it was getting converted to decimal somewhere along the way. Sorted now.
        Fwiw, for those interested the monastery transforms the provided emojis [...] within code blocks

        Actually, it is your browser that is doing that (when you submit the form). Just FYI.

        - tye        

Re^2: Regex For Removing Emoji
by Beaker (Beadle) on Nov 12, 2016 at 14:17 UTC
    No I didn't post on stack overflow, I just found similar questions posted and regex provided by response (in other languages).