1

I have given Regular Expression for Password Property as

[RegularExpression(@"^((?=.*\\d)(?=.*[a-z])(?=.*[@#$%.]).{8,16})*$", ErrorMessage = "Password must contain atleast one digit and one speacial character")]
public string Password{get; set;}

I have given password as bobby@15. I am not able to register. Is there any problem with Regular expression

1
  • I've tried to update your title to better explain your issue - feel free to amend. Commented Jul 23, 2014 at 13:57

1 Answer 1

1

Don't need to escape \d.

@"^((?=.*\d)(?=.*[a-z])(?=.*[@#$%.]).{8,16})*$"
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.