[Israel.pm] A simpler regex required

Yitzchak Scott-Thoennes sthoenna at efn.org
Tue Aug 14 17:43:22 PDT 2007


On Tue, August 14, 2007 7:22 am, Peter Gordon wrote:
> s!(<td.*?>)(.*?)(</td>)!my $t1 = $1 ;my $t2 = $2 ; my $t3 = $3 ; $t2 =~
> s/\s/&nbsp;/g ; "$t1$t2$t3" ;!egs ;

Is there a reason not to just:

s{(<td.*?>)([^ ]+) ([^ ]+) ([^ ]+) ([^ +)(</td>)}
 {$1$2&nbsp;$3&nbsp;$4&nbsp$5$6}g





More information about the Perl mailing list