I use ASP.NET 4 and C#.
I need to apply a RegEx to an RegularExpressionValidator control to NOT allow inserting in a TextBox of charters that are not in certain Unicode Categories.
Designation:
- UppercaseLetter
- LowercaseLetter
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can use
\p{CLASS}to match unicode character classes:See the “Supported Unicode General Categories” and “Supported Named Blocks” sections of the Character Classes page on MSDN for a list of supported character classes.
See also this question: Regular expression to catch letters beyond a-z
Edit: Keep in mind that this won’t work in the browser as I don’t think the client implementations of Regex support
/p.