Oh, my. I fear I may have ruffled some feathers here. I apologize; I was
hoping to spark a debate, not a flame war. Could we all please take a step
back and cool off for a bit, and not let this get personal?
I'm afraid it may seem like I'm ranting about Perl 5's regular expressions,
when I onl
On Dec 14, Randal L. Schwartz said:
>Deven> I haven't even SEEN an example where the current behavior is
>Deven> actually preferable than my proposed behavior, have you? (And
>Deven> I'd expect at least a FEW, though I suspect there are probably
>Deven> more counterexamples.)
>
>If I want the le
>The crux of the problem is that non-greedy qualifiers don't affect the
>"earliest match" behavior, which makes the matches more greedy than they
>really ought to be.
>
>Here is a simple example: (tested with perl 5.005_03)
>
> $_ = "";
> ($greedy) = /(b.*d)/;
> "Deven" == Deven T Corzine <[EMAIL PROTECTED]> writes:
Deven> I haven't even SEEN an example where the current behavior is
Deven> actually preferable than my proposed behavior, have you? (And
Deven> I'd expect at least a FEW, though I suspect there are probably
Deven> more counterexamples.
> "Deven" == Deven T Corzine <[EMAIL PROTECTED]> 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
>No question that's how it's been implemented. But WHY would anyone want
>such behavior? When is it beneficial?
It is beneficial because this is how it's always been, because it
is faster, because it is more expressive, because it is more powerful,
because it is more intuitive, and because it i
Jarkko Hietaniemi writes:
> Couldn't the be an option (a modifier) to do this? Then if someone
> asks to wait until all the electrons spin down, so be it...
Only if we can get MjD's wordy regex modifiers:
/a.*?b/{heatdeath}
Nat :-)
On Thu, Dec 14, 2000 at 04:19:15PM -0700, Nathan Torkington wrote:
> Deven T. Corzine writes:
> > I haven't even SEEN an example where the current behavior is actually
> > preferable than my proposed behavior, have you? (And I'd expect at least a
> > FEW, though I suspect there are probably more
Deven T. Corzine writes:
> I haven't even SEEN an example where the current behavior is actually
> preferable than my proposed behavior, have you? (And I'd expect at least a
> FEW, though I suspect there are probably more counterexamples.)
I think the biggest problem with your idea is that it re
On Thu, 14 Dec 2000, Jeff Pinyan wrote:
> On Dec 14, Deven T. Corzine said:
>
> >> You're asking for something like
> >>
> >> /(? >>
> >> which is an "optimization" you'll have to incorporate on your own.
> >
> >Thanks for the example. Unfortunately, your attempted workaround doesn't
> >ev
On Dec 14, Deven T. Corzine said:
>> You're asking for something like
>>
>> /(?>
>> which is an "optimization" you'll have to incorporate on your own.
>
>Thanks for the example. Unfortunately, your attempted workaround doesn't
>even work for the example string; the "a" preceding "d"
On Thu, 14 Dec 2000, Jeff Pinyan wrote:
> On Dec 14, Deven T. Corzine said:
>
> >The crux of the problem is that non-greedy qualifiers don't affect the
> >"earliest match" behavior, which makes the matches more greedy than they
> >really ought to be.
>
> That's because "greediness" is just a m
On Thu, 14 Dec 2000, Tom Christiansen wrote:
> >Does anyone disagree with the premise, and believe that "d" is the
> >CORRECT match for the non-greedy regexp above?
>
> Yes. The Camel's regex chapter reads:
>
> You might say that eagerness holds priority over greed (or thrift).
N
On Dec 14, Deven T. Corzine said:
>The crux of the problem is that non-greedy qualifiers don't affect the
>"earliest match" behavior, which makes the matches more greedy than they
>really ought to be.
That's because "greediness" is just a measure of crawl vs. backtrack. The
regex /a.*b/ will ma
>Does anyone disagree with the premise, and believe that "d" is the
>CORRECT match for the non-greedy regexp above?
Yes. The Camel's regex chapter reads:
You might say that eagerness holds priority over greed (or thrift).
>For what it's worth, here's a quote from a Perl 5.005_03 "p
Non-greedy matching is a very valuable Perl 5 regular expression feature
that simplifies many regular expressions. However, early on I discovered
what seems to be a failure of the mechanism -- matches were MORE greedy
than necessary. I'm not sure if other people noticed this, or just failed
to c
16 matches
Mail list logo