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

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

Deven T. Corzine
December 15, 2000 11:25
Re: Perl 5's "non-greedy" matching can be TOO greedy!
Message ID:

On 14 Dec 2000, Randal L. Schwartz wrote:

> >>>>> "Deven" == Deven T Corzine <> writes:
> Deven> I'm not pushing for this to be fixed in Perl 5; it's been out
> Deven> there long enough, and there's no point worrying about it in
> Deven> that version.  But that doesn't mean that the same design flaw
> Deven> should be kept in Perl 6, when some minor incompatibilities are
> Deven> to be expected...
> But *I* don't see it as a design flaw.  I predicted precisely what was
> going to be matched.  Perhaps it's merely a matter of understanding
> and experience.  I think the current definition is precisely
> predictable in all circumstances.  If you start adding special-case
> rules, you'll lose.  Big time.
> No bug.  Just a feature you don't (yet) understand.

As I said in another message, I believe I erred in describing it as a
"flaw", since it is a design decision, and there are valid justifications
for either choice.  Therefore, I'll henceforth escribe it as a "semantic
anomaly", which I hope will be more value-neutral.  Maybe the anomaly is
real, or maybe it's a mirage.  I believe it is real; we'll see whether or
not I'll be able to convince anyone else.  It quite seems that people's
minds were made up long before the discussion even began, which makes this
a very steep uphill battle for me.

As for special-case rules, I believe that my proposed modification would
REMOVE a special-case semantic rule, at the cost of added complexity at the
implementation level.  (The cost decision of whether that added complexity
is worthwhile is a separate consideration.)

And I'd really appreciate it if everyone would refrain from suggesting that
I don't understand the behavior.  I understand it fine; I just don't agree
with it.  In the language of the Supreme Court, "I respectfully dissent."
Just because I don't perfectly agree with the semantics that were chosen
doesn't mean I don't understand them.

Deven Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About