I was able to come up with something but it raised a question. Can you write a regex that matches all strings not containing the substring string 'foo'?
Here are my particular details...
this works, but it seems that I should be able to do this in a single s/// instead 2 matches and a swap. Thanks for taking the time to look at my post. I did a search for docs before posting but I could certainly have missed something. Pointers to pertinent nodes are appreciated.#!/usr/bin/perl while(<DATA>) { if(m/<img\s+src="\/images\/blank.gif"/ && !m/display:block/) { print; s|(<img\s+src="/images/blank.gif".*?)>|$1 style="display:block +">|; print; } } __DATA__ <img src="/images/blank.gif" border="0"> <img src="/images/blank.gif" border="0" style="display:block" > <img src="/images/blank.gif" border="0">
Ira,
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |