Regular expression to validate name in .NET multilingual web application
- by BT
Hi, how can i write a regular expression to validate name field in a multilingual web application, i want to validate the name field for non-English languages e.g. Spanish or German, and we need to make sure that no one enter digits or special characters. I'm using .NET.
I believe we can't use expression as below for non-English language.
^[a-zA-Z]{1,20}$
Any help will be highly appreciated!
Solution: I'm using this regular expression
^\p{L}[\p{L}\p{Pd}\x27]*\p{L}$
, and the below MSISDN article was very helpful:
MSDN - Regular Expression
Also below tool is very helpful, in validating your regular expression:
Regex Builder