Reputation: 21810
I am using the following regex:
$regex = "/Built upon the <a href=\"[^>]+banshee-php\\.org/\">[a-z]+<\/a>(?:v([\\d.]+))?\\;version:\\1/U";
And i'm running it against the markup of a typical webpage using preg_match
but its dying at a quotation mark.
preg_match(): Unknown modifier '"'
Since all of the quotes are already escaped, I'm not sure why its not running.
Upvotes: 1
Views: 66
Reputation: 784998
You can avoid all the escaping by choosing a different regex delimiter
and using single quotes around your string like this:
$re='~Built upon the <a href="[^>]+banshee-php\.org/">[a-z]+</a>(?:v([\d.]+))?\\;version:\1~U';
Upvotes: 2