I'm using gskinner regex helper site to capture a date from a string and it works fine. But throws and error in my php script.
What I'm looking for is the date within the string.
Nov 26 2013 10:17PM
$string = "The following web lead was received at Nov 26 2013 10:17PM Source: 420 Source: Internet - Organic (Free) Leads Referral Fee: none";
$datePattern = '/(?<=received at )(?:[^])*?(?=Source)/';
preg_match($datePattern,$string,$matches);
print_r($matches);
The error I'm getting is
Warning: preg_match(): Compilation failed: missing terminating ] for character class at offset 36 in C:\wamp\www\test\index.php on line 114
I don't understand why it works fine in the gskinner tool but fails in my script. This regex is one of the community submitted expressions as I am completely incompetent when it comes to regex.
Thanks for any help.