0

I used this regex to clear string from any non-alphanumeric characters

/[^0-9a-z]/gi

However, in my program there some strings with Arabic, Hebrew, Chinese and Dutch chars that are cleaned by this regex. For future support I would like to use regex that will not clean any alphanumeric chars on any language. Is it possible to create such one?

AlexBerd
  • 1,368
  • 2
  • 18
  • 39

1 Answers1

-1

Maybe you can try it with a unicode escape.

[\u0041-\u005A] is the equivalent to [A-Z].

[\u0600—\u06FF] would be the arabic chars as an example.

The codes you can look up on: https://unicode-table.com/en/

Also here they are grouped: https://unicode-table.com/en/blocks/control-character/

lordnik22
  • 48
  • 1
  • 8