develooper Front page | perl.beginners | Postings from April 2002

Re: grep (small doubt)

Thread Previous | Thread Next
From:
Mandar Rahurkar
Date:
April 2, 2002 23:56
Subject:
Re: grep (small doubt)
Message ID:
Pine.GSO.4.33.0204030050530.20890-100000@cslr.Colorado.EDU
I am  using following regexp :

 $skip=1;

 @list_neutral=grep /^.{3,4}[^d][^skip].*\.fea$/, @list;

this does not match as 3|4 option matches everything :(

Mandar
On Wed, 3 Apr 2002, Sudarsan Raghavan wrote:

> Mandar Rahurkar wrote:
>
> > Hi,
> >   Its me again..
> >
> > 169b2_vow_band_1.fea
> > 2168d6_vow_band_1.fea
> >
> > @files = grep /^.{3}g[^1].*\.fea$/, @files;
> >
> > can i have an or like for eg :
> > @files = grep /^.{3|4}g[^1].*\.fea$/, @files;
> >
>
>     You can write it as /^.{3,4}g(?!1).*\.fea$/
>     .{3,4} matches atleast 3 but not more than 4.
>
> >
> > Many Thanks
> > Mandar
> >
> > --
> > To unsubscribe, e-mail: beginners-unsubscribe@perl.org
> > For additional commands, e-mail: beginners-help@perl.org
>
>
> --
> To unsubscribe, e-mail: beginners-unsubscribe@perl.org
> For additional commands, e-mail: beginners-help@perl.org
>


Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About