Using a few different patterns but they each come up with this error - so what's wrong?
My shortest one to diagnose is:
$pattern = "<img([^>]*[^/])>";
preg_match_all($pattern, $subject, $matches);
Thanks
Using a few different patterns but they each come up with this error - so what's wrong?
My shortest one to diagnose is:
$pattern = "<img([^>]*[^/])>";
preg_match_all($pattern, $subject, $matches);
Thanks
You are lacking the regexp delimiters. Try:
$pattern = "#<img([^>]*[^/])>#i";
A single slash is the default delimiter, which is why the character after it in your original regex was in the error-message. Using the traditional slashes as delimiters and escaping the slash that is not a delimiter would look like this:
$pattern = "/<img([^>]*[^\\/])>/";