Suppose I want to match all strings except one: “ABC”
How can I do this?
I need this for a regular expression model validation in asp.net mvc 3.
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.
Normally you would do like
So for example:
All the strings that aren’t
ABCDecomposed it means:
Technically you could do something like
Decomposed it means
using a negative look behind, but it is more complex to read (and to write)
Ah and clearly not all the regex implementations implement them 🙂 .NET one does.