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
From:
Tom Christiansen
Date:
December 15, 2000 13:02
Subject:
Re: Perl 5's "non-greedy" matching can be TOO greedy!
Message ID:
18372.976914117@chthon
>You can't explain why "bbbbccccd" matches without making reference to the
>absolute priority of the leftmost rule.  "bccccd" would still make sense
>(locally) without reference to that rule.

Nope.  Nope, nope, and nope.

Th8is /bbbbccccd/ thing, which is completely unrealistic and
non-real-worldly, says:

	find a 
    b
	such that this is immediately followed by 
    b
	such that this is immediately followed by 
    b
	such that this is immediately followed by 
    b
	such that this is immediately followed by 
    c
	such that this is immediately followed by 
    c
	such that this is immediately followed by 
    c
	such that this is immediately followed by 
    c
	such that this is immediately followed by 
    d

If you think that people for "find a b" to suddently mean 
something stochastic, you know different people than I do.

--tom

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About