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

  1. Input should be 1 capital letter
  2. 1 lowercase letter
  3. Input should be 1 number
  4. 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

Popular posts from this blog

php - PDO bindParam() fatal error -

logging - How can I log both the Request.InputStream and Response.OutputStream traffic in my ASP.NET MVC3 Application for specific Actions? -

java - Why my included JSP file won't get processed correctly? -