[Israel.pm] matching in line (fwd) on behalf of Ernst, Yehuda.B

Offer Kaye offer.kaye at gmail.com
Fri Dec 3 04:24:16 PST 2004


On Thu, 2 Dec 2004 17:10:02 +0200, Friedman, Roee
<rfriedman at ndsisrael.com> wrote:
> # Using backreferences
> print 1 if $var1 =~ /(\w)\1{4}/;

Or inside a while loop (where "IN" is a filehandle to your input file):
while(<IN>) {
   print if /(\w)\1{4}/;
}

Regards,
-- 
Offer Kaye



More information about the Perl mailing list