Regular Expression for Passwords

This is just a note to myself really, below is the regular expression for a string or in my case password where you require it to have at least one letter, one number, a limited selection of special characters (optional) and a minimum of 8 characters in length:

View Code REGEX
1
^(?=.{8,})(?=.*\d)(?=.*[a-zA-Z])[a-zA-Z0-9@#$%^&+=\*]*$

Related posts:

  1. Select/Invite all friends on Facebook automatically
  2. Email to SMS / Email to Mobile, Free Database
  3. [PHP] Get current time in milliseconds
  4. GoDaddy mod_rewrite Hell
  5. PHP: unset() not freeing memory fully on objects

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>