in reply to Re: Add tag
in thread Add tag
The above code does not work#!/usr/bin/perl while(<DATA>){ if (/^(\[\w+\])/) { $f = $1; } elsif ($f =~ m/\[NEW\]/) { # $_ =~ s/\[NEW\](.*){\w*}/<p>$1<\/p>/g; $_=~ s/<$/<\/p><p>/g; s/(\[NEW\].+?)\<?(\n\[)/$1<p>$2/xsg; print $_; } } __DATA__ [NEW] Dear Carolyn: My husband and I divorced after 42 years. It didn't tak +e long for him to find a replacement, but I was happy for him at the time.< them and let my grandchildren dig through her purse as if she were the +ir grandmother.< [OLD]
|
|---|