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>
This commit is contained in:
René Scharfe
2009-01-17 16:50:37 +01:00
committed by Junio C Hamano
parent 8cc3299262
commit f9b7cce61c
4 changed files with 13 additions and 11 deletions

View File

@ -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 }
};