Can anyone help me with a regex to allow atleast one special character, one uppercase, one lowercase.
This is what I have so far:
It can be done quickly by 3 regular expression.
function check($string){
return preg_match("/[`!%$&^*()]+/", $string)
&& preg_match("/[a-z]+/", $string)
&& preg_match("/[A-Z]+/", $string) ;
}
Dont forget to tweak the list of special characters. Because I dont know what characters you think are special.
I believe wasting a lot of time on a single line regex while you are not expert will not increase your productivity. This 3 regex solution will do just fine. It saves time.