diff options
author | René Scharfe <rene.scharfe@lsrfire.ath.cx> | 2009-01-17 16:50:37 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2009-01-18 03:30:41 +0100 |
commit | f9b7cce61cbd19c99e89b859b5909f0741111185 (patch) | |
tree | ec1bce95ebd9d81581ebd3efad9e578cd8abb6a0 /test-ctype.c | |
parent | Change NUL char handling of isspecial() (diff) | |
download | git-f9b7cce61cbd19c99e89b859b5909f0741111185.tar.xz git-f9b7cce61cbd19c99e89b859b5909f0741111185.zip |
Add is_regex_special()
Add is_regex_special(), a character class macro for chars that have a
special meaning in regular expressions.
Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'test-ctype.c')
-rw-r--r-- | test-ctype.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/test-ctype.c b/test-ctype.c index d6425d5b40..033c74911e 100644 --- a/test-ctype.c +++ b/test-ctype.c @@ -26,6 +26,11 @@ static int test_is_glob_special(int c) return is_glob_special(c); } +static int test_is_regex_special(int c) +{ + return is_regex_special(c); +} + #define DIGIT "0123456789" #define LOWER "abcdefghijklmnopqrstuvwxyz" #define UPPER "ABCDEFGHIJKLMNOPQRSTUVWXYZ" @@ -40,6 +45,7 @@ static const struct ctype_class { { "isalpha", test_isalpha, LOWER UPPER }, { "isalnum", test_isalnum, LOWER UPPER DIGIT }, { "is_glob_special", test_is_glob_special, "*?[\\" }, + { "is_regex_special", test_is_regex_special, "$()*+.?[\\^{|" }, { NULL } }; |