Enh: Windows: add support for "ignorecase" matches to .hgignore

Marcin Kasperski Marcin.Kasperski at softax.com.pl
Fri Jul 13 09:10:01 CDT 2007


Dnia piątek, 13 lipca 2007 06:31, Bela Babik napisał:
> Enh: Windows: add support for "ignorecase" matches to
> .hgignore
>
> It doesn't need to be line-by-line base, it could be
> implemented as a modifier or new kind of pattern type.
> ("regexp,i" or "regexpi" or something like that)

Python regexp syntax already handle ignorecase. Just add (?i) 
inside regexp. Example:

>>> import re
>>> print re.search('\.bak$', 'blabla.bak')
<_sre.SRE_Match object at 0xb7db2608>
>>> print re.search('\.bak$', 'blabla.BAK')
None
>>> print re.search('(?i)\.bak$', 'blabla.BAK')
<_sre.SRE_Match object at 0xb7db2608>

So, just use this syntax in your .hgignore


More information about the Mercurial mailing list