http://www.perlmonks.org?node_id=1013989

userdefinable has asked for the wisdom of the Perl Monks concerning the following question:

I need a regex to match everything except
[img]anything[/img]
where "anything" is a string ending in one of the following: .jpg .jpeg .png .gif .bmp I have this:
\[img\].*[^jpg]\[\/img\]
Which matches anything except string ending in jpg within the tags, but when I try to add the "or" bits it goes horribly wrong. Please help, thanks