Combining multiple RegEx expressions to restrict passwords -
I have to put a RegEx expression on the property in a model on the MVC website on which I am working.
The different pieces of expression I understand personally, but I can not understand how to convert them together.
I should be able to restrict the input in letters, Capital letters, numbers, and symbols @ _ -
Then I need to make sure the user input
- Input should be 1 capital letter
- 1 lowercase letter
- Input should be 1 number
- 4 signals acceptable in input Must be one of them.
I have tried
"^ (? =. * [Az]) (? =. * [Az]) (? =. * \\ d) (? =. * [@ -_.]) [A-Za-z \\ d @ -_.] {8,} "
But this password Does not include one of the 4 symbols.
You need to avoid your regex for special characters - Updated regex:
"^ (? =. * [Az]) (? =. * [Az]) (? =? * \\ d) (? =. * [@ \ -_.]) [A] -Za-z \\ d @ \ -_.] {8,} "
Comments
Post a Comment