i’m using C# and i’m trying to allow only alphabetical letters and spaces. my expression at the moment is:
string regex = '^[A-Za-z\s]{1,40}$';
my IDE says that \s is an ‘Unrecognized escape sequence’
what am i missing?
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.
‘\’ is a c# escape character as well as a regex escape character. Try: