[Israel.pm] matching in line (fwd) on behalf of Ernst, Yehuda.B
Yosef Meller
mellerf at netvision.net.il
Thu Dec 2 08:16:57 PST 2004
> From: "Ernst, Yehuda" <yernst at nds.com>
>
> Hello!
>
> I need to read a text file line by line and check every line if it has 5
> same chars together in it.
>
> if the file looks like this
>
> lksdjvhhgaeifgas;dfjnafb
> dlsjfhgq30874riwufh;wdofia
> jsg55555dsbafoiewury20348r7y2-3495
>
> only line 3 will be printed
>
> is there a fast way using pattern match to do it?
>
perl -ne 'print if /\d{5}/'
Is this what you wanted?
--
Keep on rocking in a free world!
More information about the Perl
mailing list