use strict; my $html = do { local $/; <DATA> }; $html =~ s/(<[^>]+>\s*)(.*)(?=\s*<[^>]+>)/$1<b>$2<\/b>/gm; print "$html\n"; __DATA__ <p> blah blah <blockquote> blah </blockquote> blah <p>
<p> <b>blah blah</b> <blockquote> <b>blah</b> </blockquote> <b>blah</b> <p>
In reply to Re: Regex: How do I use lookahead with search/replace?
by Roger
in thread Regex: How do I use lookahead with search/replace?
by tunesmith
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |