Which regular expression can I use to match (allow) any kind of letter from any language?
I need to match any letter including any diacritics (e.g., á, ü, ñ)
and exclude any kind of symbol (math symbols, currency signs, dingbats, box-drawing characters, etc.) and punctuation characters.
I’m using ASP.NET MVC 2 with .NET 4. I’ve tried this annotation in my view model
[RegularExpression(@"\p{L}*", ...
and this one
[RegularExpression(@"\p{L}\p{M}*", ...
but client-side validation rejects accented characters.
UPDATE:
Thank you for all your answers. Your suggestions work but only for .NET, and the problem here is that it also uses the regex for client-side validation with JavaScript.
I had to go with
[^0-9_\|°¬!#\$%/\\\(\)\?¡¿\+\{\}\[\]:\.\,;@ª^\*<>=&]
which is very ugly and does not cover all scenarios but is the closest thing to what I need.
One thing to watch out for is the client-side regex. It uses javascript regex on the client side and .net regex on the server side. Javascript won’t support this scenario.