I might have simplified this too much, but: $html = '<!--% xxxx UNO xxxx %--> <!--% xxxx DOS xxxx %-->'; $html =~ s/<!--%(.*?) DOS (.*?)%-->/GONE/s; print $html; what I want to produce is leave the first comment tag, while replacing the second with GONE (and yes I do need to grab the xxxx tex +t) the 'xxxx' in both tags may be anything, and may span several lines I may not always be looking for 'DOS', this was just an example. my problem is that it chews up the first one, starting with <!--% from UNO's tag, and ending with --> from DOS's tag..
In reply to UNO DOS, HTML by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |