[Israel.pm] Regexp

Mikhael Goikhman migo at homemail.com
Thu Jun 2 02:04:25 PDT 2005


On 02 Jun 2005 08:53:48 +0000, Mikhael Goikhman wrote:
> 
> And if you want to make it a bit more efficient, replace
> 	$string =~ /(.+).*?\1/s
> with
> 	$string =~ s/^.*?(.+).*?\1/$&$`/s

I meant, with:
	$string =~ s/^.*?(.+)(.*?\1)/$1$2/s

Regards,
Mikhael.

-- 
perl -e 'print+chr(96+hex)for+split//,d97f08fd5d19c03fd'



More information about the Perl mailing list