Discussion:
unicode text
Add Reply
saito
2024-11-09 02:28:54 UTC
Reply
Permalink
Is there a way to remove emojis, non-printable and other graphic
characters from a string? I can use a regexp with a-zA-Z and such but
this doesn't account for valid characters from non-ascii/non-Western
languages, right?
Michael Soyka
2024-11-09 03:15:20 UTC
Reply
Permalink
Post by saito
Is there a way to remove emojis, non-printable and other graphic
characters from a string? I can use a regexp with a-zA-Z and such but
this doesn't account for valid characters from non-ascii/non-Western
languages, right?
I've found that this regular expression works for emojis:
[^[:print:][:cntrl:]]
saito
2024-11-09 17:57:27 UTC
Reply
Permalink
Post by saito
Is there a way to remove emojis, non-printable and other graphic
characters from a string? I can use a regexp with a-zA-Z and such but
this doesn't account for valid characters from non-ascii/non-Western
languages, right?
   [^[:print:][:cntrl:]]
Thanks! That is a good start.

Loading...