Re: string matching specific number of times
- From: "ced@xxxxxxxxxxxxxxxxxxxxx" <ced@xxxxxxxxxxxxxxxxxxxxx>
- Date: 30 Sep 2005 04:54:52 -0700
Dave Weaver wrote:
> ced@xxxxxxxxxxxxxxxxxxxxx <ced@xxxxxxxxxxxxxxxxxxxxx> wrote:
> >
> > Or, simply:
> >
> > my $count = 0;
> > $count++ while $something =~ /test/g;
>
> Or save yourself the loop:
>
> my $count = () = $something =~ /test/g;
There's still a loop returning values which are just discarded
by the empty list of course. Losing the counter init./increm.
is very cool though.
--
Charles DeRykus
.
- References:
- string matching specific number of times
- From: tester
- Re: string matching specific number of times
- From: Paul Lalli
- Re: string matching specific number of times
- From: ced@xxxxxxxxxxxxxxxxxxxxx
- string matching specific number of times
- Prev by Date: Re: string comparison
- Next by Date: Re: string matching specific number of times
- Previous by thread: Re: string matching specific number of times
- Next by thread: Re: string matching specific number of times
- Index(es):
Relevant Pages
|