Good day, I need to find with a regular expression all matching elements in an array using PHP, but I have a bug.
<?php $a[0]='[email protected]'; $a[1]='[email protected]'; $a[2]='[email protected]'; $a[3]='[email protected]'; $pattern = '[a-z_0-9]+@[a-z]*.[a-z]{2,}'; for ($i=0;$i<=3;++$i) { if(preg_match($pattern,$a[i])) { echo $a[i]; } } Warning: preg_match() [function.preg-match]: Unknown modifier '+' in {path to file} on line 9
Thanks.