in reply to ASCII to HTML
<br> FOO<br> BAR<p><br> <br> BAZ<p><br> <br>
$text = <<TEXT; FOO BAR BAZ TEXT $text =~s/\n{2,2}/<p>/g; $text =~s/\n{1,1}/<br>/g; $text =~ s/</\n</g; $text =~ s/>/>\n/g; print $text;
gives us this result
which i think is a little more of what you are looking for. I would suggest looking at the Regular Expressions book by O'Reilly. I left out some optimizations so you could go hunting for them.FOO <br> BAR <p> BAZ <br>
take care
|
|---|