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 do:

  /e(?{ push @bar, pos })(?!)/;

If 'e' is more than one character, you'll need to use

  /(?>pattern)(?{ push @bar, pos })(?!)/;

You could also use $-[0] instead of pos().

--
Jeff "japhy" Pinyan         %  How can we ever be the sold short or
RPI Acacia Brother #734     %  the cheated, we who for every service
http://japhy.perlmonk.org/  %  have long ago been overpaid?
http://www.perlmonks.org/   %    -- Meister Eckhart

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to