On Fri, 15 Dec 2000, Deven T. Corzine wrote: > Not at all. I don't want it to keep looking after it finds the first > match. I want it to make sure that match isn't unnecessarily long, if > non-greedy matching was in use. Conceptually (I don't think this would be > a good implementation), you find the first match as the current engine > does, then search for the smallest possible match WITHIN that first match. > Since it will already be as short as possible from the starting point, this > amounts to advancing the starting point as far as possible without changing > the ending point, as long as it still matches. Actually, I'm not sure -- it's conceivable that the ending point would ALSO move inward for a different starting point within the original match. But the ending point should NEVER be advanced further -- that's where the "leftmost over nongreedy" rule should apply instead... Deven
- Re: Perl 5's "non-greedy" m... Nathan Torkington
- Re: Perl 5's "non-greedy" m... Deven T. Corzine
- Re: Perl 5's "non-greedy" match... Deven T. Corzine
- Re: Perl 5's "non-greedy" m... Jonathan Scott Duff
- Re: Perl 5's "non-greedy" m... Deven T. Corzine
- Re: Perl 5's "non-greedy" m... Kevin Walker
- Re: Perl 5's "non-greedy" m... Jarkko Hietaniemi
- Re: Perl 5's "non-greedy" m... Tom Christiansen
- Re: Perl 5's "non-greedy" m... Kevin Walker
- Re: Perl 5's "non-greedy" m... Bart Lateur
- Re: Perl 5's "non-greedy" m... Deven T. Corzine
- Re: Perl 5's "non-greedy" m... Tom Christiansen
- Re: Perl 5's "non-greedy" m... Deven T. Corzine
- Re: Perl 5's "non-greedy" matching ... Randal L. Schwartz
- Re: Perl 5's "non-greedy" match... Jeff Pinyan
- Re: Perl 5's "non-greedy" m... Deven T. Corzine
- Re: Perl 5's "non-greedy" m... Deven T. Corzine
- Re: Perl 5's "non-greedy" match... Deven T. Corzine
- Re: Perl 5's "non-greedy" m... Tom Christiansen
- Re: Perl 5's "non-greedy" matching can be TO... Randal L. Schwartz
- Re: Perl 5's "non-greedy" matching can ... Deven T. Corzine