>Really?  I haven't taken a survey, but I did ask one co-worker for his
>first impression of what the regexp (from my example) would match.  Not
>being an experienced Perl programmer, but being familiar with regular
>expressions, he believed he understood the idea of non-greedy matching.
>His expectation?  That would match "bccccd", not "bbbbccccd".

I'm sure you invalidated the test results by giving the wrong set up.
Listen very closely:

    PERL DOES NOT HAVE GREEDY MATCHING.

Got that?  Neither does it have stingy matching.  Only the quantifiers
have such a property.  NOT THE MATCH ITSELF.    Wait, let me say it again:

    PERL DOES NOT HAVE GREEDY MATCHING.

There is no global greed, only local greed.  And greed is a misleading
term.

--tom

Reply via email to