[PATCH] ignore: add case-insensitive globs support

Matt Mackall mpm at selenic.com
Wed Mar 30 15:19:03 CDT 2011


On Wed, 2011-03-30 at 22:02 +0200, Roman Neuhauser wrote:
> # mpm at selenic.com / 2011-03-30 12:45:56 -0500:
> > Yep, setting any of the (?x) flags in any pattern will have a global
> > effect across patterns. In general, doing "clever" things with ignore
> > regexes probably won't do what you want.
> 
> if all the patterns are '|'.join()ed together, doesn't this have an
> easy solution in
> 
> '|'.join(map(lambda p: '(?:'+p+')'))

No:

>>> import re
>>> re.match("(?:(?i)hi)", "HI")
<_sre.SRE_Match object at 0x7f79dcb1c780>
>>> 

-- 
Mathematics is the supreme nostalgia of our time.




More information about the Mercurial-devel mailing list