4

One of my project requirements is to validate a data field(text box from web page). I need to allow alpha numeric characters in all foreign languages (japanese,chinese,korean,russian,latin american characters etc). And avoid special characters.

I am using the expression /[^a-zA-Z0-9]/ (javascript, asp .net page)

Many blogs I have read and not able to correctly understand what exactly I have to do here. I can't add any addons or plugins and have to use the available functionality of regex.

How do regex engine recognize other language characters (esp. Unicode)?

halfer
  • 19,824
  • 17
  • 99
  • 186
SNA
  • 7,528
  • 12
  • 44
  • 60
  • possible duplicate of [Regular expression to match non-english characters?](http://stackoverflow.com/questions/150033/regular-expression-to-match-non-english-characters) – mplungjan Apr 04 '12 at 08:00
  • Possible duplicate of [Regular expression to match non-English characters?](http://stackoverflow.com/questions/150033/regular-expression-to-match-non-english-characters) – halfer Feb 15 '17 at 08:46

1 Answers1

3

You will need to use Unicode regular expressions. Please check this previous SO thread in which various unicode matching mechanisms are discussed.

Community
  • 1
  • 1
npinti
  • 51,780
  • 5
  • 72
  • 96