monotone-devel
[Top][All Lists]
Advanced

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

Re: [Monotone-devel] Re: collections are gone; netsync version bumped


From: Timothy Brownawell
Subject: Re: [Monotone-devel] Re: collections are gone; netsync version bumped
Date: Wed, 01 Jun 2005 18:54:38 -0500

On Wed, 2005-06-01 at 17:32 +0200, Peter Simons wrote:
> Timothy Brownawell writes:
> 
>  > You keep an old version around until the server is
>  > updated.
> 
> Alright.
> 
> Is there any chance of getting support for "not" matches? So
> that I could synchronize all to.cryp.* branches _except_
> to.cryp.foobar by specifying something like this:
> 
>   !^to\.cryp\.foobar$
>   ^to\.cryp.*

The entire string has to be matched, so the ^ and $ are redundant.
Meaning, for example, that "monotone" and ".*monotone.*" are entirely
different.

> I know about [^...] in regular expressions, but that's not
> quite the same.

We're using boost::regex, which already supports what you want:

Forward Lookahead Asserts  
There are two forms of these; one for positive forward lookahead
asserts, and one for negative lookahead asserts:

"(?=abc)" matches zero characters only if they are followed by the
expression "abc".

"(?!abc)" matches zero characters only if they are not followed by the
expression "abc".

http://www.boost.org/libs/regex/doc/syntax.html

So, to\.cryp\.(?!foobar).* is what you want.

Tim






reply via email to

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