I am trying to get this work for a while but in vain.
I want to create a php regex to check if a string has atleast one number and atleast one of the symbols amongst ( _-+=*& )
This is my regex
$result = preg_match('/^(?=.*\d)(?=.*[_-+=*&]).{3,}$/',$pass);
I get the following error
Warning: preg_match() [function.preg-match]: Compilation failed: range out of order in character class at offset 17 in myfile.php on line 8
any help ?
The
-needs to be escaped, or placed at the start / end of the[...]list:If you don’t,
-is interpreted as the range operator and ifx > yin[x-y]you get that error.