November 8th, 2007, 06:21 PM
Preg_match unknown modifier
Getting a PHP warning and non-performing regex with this code:
My goal is to have: $location = COLUMBIA, Mo.
$subject = "<p>COLUMBIA, Mo. (AP) -- A few years ago";
$pattern = "/<p>(.*)\(AP\)/";
preg_match($subject, $pattern, $location);
When I test just the regex in a regex tester it runs fine. When I run this code in PHP I get a warning and the array has no values:
PHP Warning: Unknown modifier '<' in /var/www/vhosts/allgamesfree.com/httpdocs/fanbash/mapdata.php on line 40
Any help? Thanks!
November 8th, 2007, 06:37 PM
November 9th, 2007, 08:45 AM
What a stupid rule!
Originally Posted by requinix
And I was so proud of myself for figuring out the regex on my own.