Ignore Regex negative lookahead?

Bill Barry after.fallout at gmail.com
Tue Jul 15 11:28:11 CDT 2008


Martin Geisler wrote:
> Bill Barry <after.fallout at gmail.com> writes:
>
>   
>> I am trying to get hg to ignore everything except a couple of
>> folders within a directory (two folders actually), but the only way
>> I can think of to do so would be to use a negative lookahead regex:
>>
>> Containers/(?!DNN-(Blue|Gray))
>>
>> That should pass for everything in the Containers folder except for
>> the two folders "DNN-Blue" and "DNN-Gray" (which I need committed).
>>     
>
> Okay -- I use a very similar regexp to ignore all .html files except
> in two folders in the root of the repository:
>
>   ^(?!api/|doc/).*\.html$
>   
It seems like there is an error in my regex somehow, getting rid of the 
alternation group makes it work:

Containers/(?!DNN-Blue|DNN-Gray)

Is this a bug in python regular expressions?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://selenic.com/pipermail/mercurial/attachments/20080715/b4f42933/attachment.htm 


More information about the Mercurial mailing list