It's a vBulletin forum running on php. The reason is pictures posted in photobucket tend to disappear after a year or so when the member deletes them, or when they exceed the bandwidth of their photobucket account, rendering really good posts useless. I realise this bit of code will annoy a lot of people but I'd like to trial it to see if the majority will use the various options we have on the forum server.
The IMG tags could be upper case or lower case. I want to change anything between and including the image tags to an error message where the site is a problematic external image host, but there can be a number of image tags on the same post and I want to retain the rest of the post.
Will try your code. Problem I've been having is constraining the replacement to the image tags on the ends and saying anything between them mentioning badserver should be replaced.