On Thu, 14 Dec 2000, Jeff Pinyan wrote: > You could use my sexeger technique to get this behavior (possibly): > > $string = "aaabbbcccdddeee"; > # regex to be reversed: /b(.*?)d/ > $revstr = reverse $string; > ($match) = $revstr =~ /d(.*?)b/; > > No, that doesn't quite work. It works when you unroll the .*? loop: > > # regex to be reversed: /b([^bd]*)d/ > ($match) = $revstr =~ /d([^bd]*)b/; > > But then why would you use sexeger at all, when you can unroll the loop in > the forward direction? > > ($match) = $string =~ /b([^bd]*)d/; I'm not asking for help with workarounds. If I ever need to workaround the current behavior, I won't have any trouble doing so. It's just that (on a philosophical note) I don't believe this is something that should require a workaround. Obviously, others disagree. Deven
- Re: Perl 5's "non-greedy" ma... Jarkko Hietaniemi
- Re: Perl 5's "non-greedy" ma... Tom Christiansen
- Re: Perl 5's "non-greedy" ma... Kevin Walker
- Re: Perl 5's "non-greedy" ma... Bart Lateur
- Re: Perl 5's "non-greedy" ma... Deven T. Corzine
- Re: Perl 5's "non-greedy" ma... Tom Christiansen
- Re: Perl 5's "non-greedy" ma... Deven T. Corzine
- Re: Perl 5's "non-greedy" matching c... Randal L. Schwartz
- Re: Perl 5's "non-greedy" matchi... Jeff Pinyan
- Re: Perl 5's "non-greedy" ma... Deven T. Corzine
- Re: Perl 5's "non-greedy" ma... Deven T. Corzine
- Re: Perl 5's "non-greedy" matchi... Deven T. Corzine
- Re: Perl 5's "non-greedy" ma... Tom Christiansen
- Re: Perl 5's "non-greedy" matching can be TOO... Randal L. Schwartz
- Re: Perl 5's "non-greedy" matching can b... Deven T. Corzine
- Re: Perl 5's "non-greedy" matching c... Randal L. Schwartz
- Re: Perl 5's "non-greedy" matchi... Deven T. Corzine
- Re: Perl 5's "non-greedy" ma... brian d foy
- Re: Perl 5's "non-greedy" matchi... Simon Cozens
- Re: Perl 5's "non-greedy" ma... Deven T. Corzine
- Re: Perl 5's "non-greedy" ma... brian d foy