Reputation: 81
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
Upvotes: 1
Views: 136
Reputation: 174696
Don't need to escape \d
.
@"^((?=.*\d)(?=.*[a-z])(?=.*[@#$%.]).{8,16})*$"
Upvotes: 1