I'm not very knowledgeable with regular expresions, so I don't understand why I'm getting this error.
I'm using the following code to match all the emails in the string $str
and saving them in the array $match
:
preg_match_all(
"/^[a-zA-Z0-9.!#$%&’*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/",
$str,
$match
);
Apparently there's a problem in the regex (which I got from here) because I'm getting this error:
Warning: preg_match_all() [function.preg-match-all]: Unknown modifier '=' in C:\xampp\htdocs\project\Framework\Sanitizer.class.php on line 38
Can someone tell me what's the problem?
Thanks