JavaScript regex for checking alphanumeric characters, all international characters (Japanese, Chinese, Russian, etc.)

One of my project requirements is to validate a data field (text field on a web page). I need to allow alphabetic characters in all foreign languages ​​(Japanese, Chinese, Korean, Russian, Latin, etc.). And avoid special characters.

I am using expression /[^a-zA-Z0-9]/

(javascript, asp.net page)

Many blogs that I have read and are not able to correctly understand what exactly I need to do here. I can't add any add-ons or plugins and use the regex functions available.

How does the regex engine recognize other characters in the language (especially Unicode)?

+3


source to share


1 answer


You will need to use regular expressions Unicode

. Please check this previous SO thread for a discussion of various unicode negotiation mechanisms.



+3


source







All Articles