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

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

Thread Previous | Thread Next
Tom Christiansen
December 15, 2000 15:27
Re: Perl 5's "non-greedy" matching can be TOO greedy!
Message ID:
>Nice summary, but I'm not buying what you're selling in the elaboration.

Then you lose, because I am not allowed to disagree with you anymore.
And everyone else has already written you off.

And the answer to "what breaks if mimimal matching is overall but
maximal matching is local"--or even, "if we change it all"-- is
a zillion programs, including just about any progressive match:

    while (/.*?(\w+)=(\S+)/g) {
	push @{ $h{$1} }, $2;

I can't wait for that to match the rightmost one and then fail.  Bah.



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