These should be in .hgignore, shouldn't they? $ hg status ? dpi/vsource.filter.dpi ? dpid/dpidc ? dpid/dpidrc
Jeremy wrote:
+^dpi/[^/]*\.dpi$
I get mixed up by the differences in the various regexps out there. Is this "[^/]" intended as a *looks up the term* bracket expression? The hgignore page says it uses Python/Perl syntax, and the first regexp page that I find ( http://www.greenend.org.uk/rjk/2002/06/regexp.html ) seems to say that Perl and Python just do character classes when given brackets.
corvid wrote:
Jeremy wrote:
+^dpi/[^/]*\.dpi$
I get mixed up by the differences in the various regexps out there. Is this "[^/]" intended as a *looks up the term* bracket expression?
The hgignore page says it uses Python/Perl syntax, and the first regexp page that I find ( http://www.greenend.org.uk/rjk/2002/06/regexp.html ) seems to say that Perl and Python just do character classes when given brackets.
[^...] is a negated class. [^/] matches any charar#cter other than /. If I got it right this matches all *.dpi files in the dpi/ directory. Regards, Jeremy Henty
Jeremy wrote:
corvid wrote:
Jeremy wrote:
+^dpi/[^/]*\.dpi$
I get mixed up by the differences in the various regexps out there. Is this "[^/]" intended as a *looks up the term* bracket expression?
The hgignore page says it uses Python/Perl syntax, and the first regexp page that I find ( http://www.greenend.org.uk/rjk/2002/06/regexp.html ) seems to say that Perl and Python just do character classes when given brackets.
[^...] is a negated class. [^/] matches any charar#cter other than /. If I got it right this matches all *.dpi files in the dpi/ directory.
I'm familiar with negation, but it wasn't clear from that page that _all_ regexps work that way. But putting a dpi file in a subdir now, it does exactly what we want. Ah, experimentation, it's a beautiful thing...
corvid wrote:
Jeremy wrote:
corvid wrote:
Jeremy wrote:
+^dpi/[^/]*\.dpi$
I get mixed up by the differences in the various regexps out there. Is this "[^/]" intended as a *looks up the term* bracket expression?
The hgignore page says it uses Python/Perl syntax, and the first regexp page that I find ( http://www.greenend.org.uk/rjk/2002/06/regexp.html ) seems to say that Perl and Python just do character classes when given brackets.
[^...] is a negated class. [^/] matches any charar#cter other than /. If I got it right this matches all *.dpi files in the dpi/ directory.
I'm familiar with negation, but it wasn't clear from that page that _all_ regexps work that way.
Oh sorry, I didn't realise that was your concern. I have always taken it for granted that negation with [^...] would work in any of the popular scripting languages. It just didn't occur to me to worry whether Python regexps might be any different.
But putting a dpi file in a subdir now, it does exactly what we want. Ah, experimentation, it's a beautiful thing...
Looks like I got away with it then :-) . I have pushed the patch because I think it's a no-brainer (but I'll be happy to revert/amend it if others disagree). Regards, Jeremy Henty
corvid (2011-01-08 17:30):
Jeremy wrote:
+^dpi/[^/]*\.dpi$
I get mixed up by the differences in the various regexps out there. Is this "[^/]" intended as a *looks up the term* bracket expression?
"[/]*" matches 0 or more "/" characters "[^/]*" matches 0 or more characters that are not "/". It may as well be [a-z] versus [^a-z]. So the purpose of brackets isn't changed here, i.e. they are still used to match character classes, and "^" is merely a negation. And I believe it is supported by basic, extended and pcre regexps. -- -- Rogut?s Sparnuotos
participants (3)
-
corvid@lavabit.com
-
onepoint@starurchin.org
-
rogutes@googlemail.com