On May 25, Jay Savage said:
On 5/25/05, Jeff 'japhy' Pinyan <[EMAIL PROTECTED]> wrote:
On May 25, Jay Savage said:
/e(?{push @bar, pos})/g;
should work, but seems to ignore the /g.
Because as you wrote it, the regex is in void context, which means it'll
only match once. Put it in list co
On 5/25/05, Jay Savage <[EMAIL PROTECTED]> wrote:
[snip]
>/p(?:{push @bar, pos})attern(?!)/g
oops!
make that:
/p(?{push @bar, pos})attern(?!)/g
--
daggerquill [at] gmail [dot] com
http://www.engatiki.org
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional c
On 5/25/05, Jeff 'japhy' Pinyan <[EMAIL PROTECTED]> wrote:
> On May 25, Jay Savage said:
>
> > /e(?{push @bar, pos})/g;
> >
> > should work, but seems to ignore the /g.
>
> Because as you wrote it, the regex is in void context, which means it'll
> only match once. Put it in list context:
>
>
On May 25, Jay Savage said:
/e(?{push @bar, pos})/g;
should work, but seems to ignore the /g.
Because as you wrote it, the regex is in void context, which means it'll
only match once. Put it in list context:
() = /e(?{ push @bar, pos })/g;
But this looks weird to almost anyone. I'd d
On 5/25/05, Jay Savage <[EMAIL PROTECTED]> wrote:
> On 5/24/05, Robert Citek <[EMAIL PROTECTED]> wrote:
> > I like your idea. Unfortunately, the above works only in the special
> > case where the regular expression match is actually a single-
> > character, exact match.
> >
> > Regards,
> > - Robe
On 5/24/05, Robert Citek <[EMAIL PROTECTED]> wrote:
>
> On May 24, 2005, at 3:14 PM, Jay Savage wrote:
> > One thing that springs to mind is:
> >
> >perl -le '
> >$foo = "fee fie foe foo";
> >map {$i++; push @bar, $i if $_ eq "e"} split //, $foo;
> >print join(":",@bar)'
> >
> > I'
On 5/24/05, Robert Citek wrote:
>
> I found a variation of this in the Perl Nutshell book:
>
> $ perl -le '
> $foo="fee fie foe foo" ;
> while ($foo =~ m/e/g ) {
> push @bar, pos $foo ;
> }
> print join(":", @bar); '
> 2:3:7:11
>
> Is there an equivalent way to do the same using map
Xavier Noria [XN], on Tuesday, May 24, 2005 at 22:12 (+0200) typed the
following:
XN> my $i = 0;
XN> my @bar = map $_->[1], # take second component
XN>grep $_->[0] eq 'e', # let 'e's pass
XN>map [$_, ++$i],# arrayref [char, index of cha
Am Dienstag, 24. Mai 2005 19.22 schrieb Robert Citek:
> I found a variation of this in the Perl Nutshell book:
>
> $ perl -le '
> $foo="fee fie foe foo" ;
> while ($foo =~ m/e/g ) {
> push @bar, pos $foo ;
> }
> print join(":", @bar); '
> 2:3:7:11
>
> Is there an equivalent way to do th
On May 24, 2005, at 19:22, Robert Citek wrote:
I found a variation of this in the Perl Nutshell book:
$ perl -le '
$foo="fee fie foe foo" ;
while ($foo =~ m/e/g ) {
push @bar, pos $foo ;
}
print join(":", @bar); '
2:3:7:11
Is there an equivalent way to do the same using map instead of a
10 matches
Mail list logo