Re: Perl 5's "non-greedy" matching can be TOO greedy!
[email protected] (Tom Christiansen) Fri, 15 Dec 2000 16:27:11 -0700
| Newsgroups | perl.perl6.language.regex |
|---|---|
| Message-ID | <5571.976922831@chthon> |
>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.
>>/dev/null
--tom