... or a naive one-liner state-machine ...
... makes ...perl -pe 'chomp; $s=!$s,next if s/^\s*<\/?pre>\s*$//i; $_="<p>$_</p>" +if $s; $_.="\n";' <in >out
in: out: ---------------------------------- <html> <html> ...etc... ...etc... <pre> <p>Line 1</p> Line 1 <p>Line 2</p> Line 2 <p>...etc...</p> ...etc... <p>Line n</p> Line n ...etc... </pre> </html> ...etc... </html>
In reply to Re: Substitution inside tags, as 1 line
by Perlbotics
in thread Substitution inside tags, as 1 line
by tel2
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |