Using a few different patterns but they each come up with this error - so what\'s wrong?
My shortest one to diagnose is:
$pattern = \"
]
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([^>]*[^\\/])>/";
You are lacking the regexp delimiters. Try:
$pattern = "#<img([^>]*[^/])>#i";