I am having some trouble with regex in php (preg_match_all).
I am using the following code to find an email encapsulated by <>:, i.e. :
preg_match_all("<[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})>:", $body,$matches);
For some reason PHP is blowing up at the colon with the following error:
Warning: preg_match_all() [function.preg-match-all]: Unknown modifier ‘:’ in…
Any help would be much appreciated, as I am no regex guru, and am just about out of hair to pull.
You need to use delimeters EX:
See the
/I added on both ends telling PHP where the regex starts and ends.