develooper Front page | perl.perl6.language.regex | Postings from December 2000

Re: Perl 5's "non-greedy" matching can be TOO greedy!

From:
Tom Christiansen
Date:
December 15, 2000 12:45
Subject:
Re: Perl 5's "non-greedy" matching can be TOO greedy!
Message ID:
7468.976913121@chthon
>I want the maximum level of OVERALL consistency for regular expressions as

We're there, thank you very much.  "Find a match" is the over-riding
sentiment, the principle semantic.  It is completely consistent with 
this.  You've got greed/nongreed very wrong.

>a whole, rather than immutable adherence to the "leftmost trumps nongreedy"
>rule currently in place.  Most of the time, I agree with the precedence of
>leftmost over nongreedy.  The example I gave is a case where I believe the
>strict adherence to the leftmost rule actually introduces complexity and
>makes the regular expression system less self-consistent.

You have yet to provide a concrete, real-world example of this allegation.  To
the contrary, you give unrealworld examples.  

--tom



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About