Regular expression to validate name in .NET multilingual web application
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 2.0
I believe we can't use expression as below for 开发者_运维问答non-English language.
^[a-zA-Z]{1,20}$
Any help will be highly appreciated!
I got this Regular Expression, it works fien when i uses Regex Builder but when i try it in actual web application it fails:
^\p{L}[\p{L}\p{Pd}\x27]*\p{L}$
use \w
for letter. it is multilingual friendly
精彩评论