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 ?
_-+is wrong. What does-do in a character class ([..])?-in_-+is the 17th character.