gnu-regexp-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Regexp] Precedence of Left + vs. Right [^]


From: Claude Brisson
Subject: Re: [Regexp] Precedence of Left + vs. Right [^]
Date: Thu, 15 Jan 2004 16:44:29 +0100

I think you misunderstood stingy/greedy behaviour : the regexp "tries" to
behave greedily if it can but revert to stingy if needed, as in your case.

to rewrite it, we need to know what you want exactly :-)

maybe you can try
[ab]+[^c]\Z

CloD

----- Original Message ----- 
From: "Dennis W. Bulgrien" <address@hidden>
To: <address@hidden>
Sent: Thursday, January 15, 2004 3:09 PM
Subject: [Regexp] Precedence of Left + vs. Right [^]


> The expression "[ab]+[^c]" finds "aac"; even though the '+' was suppose to
> account for both 'a's, the not-'c' found the second 'a' and matched, to my
> un-expectations.  I thought the '+' would have higher precedence (left to
right)
> than the negated character set because it is first.  How would this be
> rewritten?
>
>
>
>
>
> _______________________________________________
> Gnu-regexp-users mailing list
> address@hidden
> http://mail.gnu.org/mailman/listinfo/gnu-regexp-users





reply via email to

[Prev in Thread] Current Thread [Next in Thread]