Password Validation Rule

i am using following password validation rule

‘password’,

        'match', 'not' => true, 'pattern' => 'xxxxxxxxxxxxxx',


        'message' => 'Password is not valid.',


         ),

can somebdoy provide me a valid patter for following conditions/

one digit from 0-9,


one lowercase character,


one uppercase character,


one special character,

thanks in advance.

These are my default rules for 8 characters with at least on upper case, one lower case and one digit:




$this->_passwordStrengthRules = array(

    array('newPassword', 'length', 'min' => 8, 'message' => Yii::t('UsrModule.usr', 'New password must contain at least 8 characters.')),

    array('newPassword', 'match', 'pattern' => '/^.*(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).*$/', 'message'        => Yii::t('UsrModule.usr', 'New password must contain at least one lower and upper case character and a digit.')),

);



You can add more character class by adding more groups like (?=.*[A-Z]) in the regexp.

I use them in my usr module.