Mercurial hgignore

Christian Höltje docwhat+list.mercurial at gerf.org
Mon Mar 19 08:57:46 CDT 2007


Marcin Kasperski wrote:
>> For instance, there must be a simpler way of doing this sort
>> of thing:
>>
>> *.jpg
>> *.JPG
>> *.jpeg
>> *.JPEG
>> *.png
>> *.PNG
> 
> What about:
> 
> syntax: regexp
> 
> (?i)\.jpe?g
> (?i)\.png

They should probably have a $ at the end.

syntax: regexp
(?i)\.(jpe?g|png)$

Breakdown of what it all is doing:
(?i) -- this makes the search case insensitive
\.   -- periods (dots) need to be escaped.  They normally
match any one character.
(..|..) -- This says look for one of the things in the
parenthesis.  Each possibility is separated by a |.  So
(aa|bb|cc) would match aa or bb or cc, but not all.
e?  -- This says match 0 or 1 'e' characters.
$   -- This is the end of string.

Ciao!


-- 
When privacy is outlawed... only the outlaws have privacy.

The Doctor What: Guru to the Gods
http://docwhat.gerf.org/
docwhat *at* gerf *dot* org
       KF6VNC


More information about the Mercurial mailing list