diff options
author | Guido van Rossum <guido@python.org> | 1997-08-13 03:21:14 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1997-08-13 03:21:14 (GMT) |
commit | 52d6832554d7bd4ba4f24b8b50431ea3da70708c (patch) | |
tree | 301b8cf14258290f281c37cd8051da2411b93e67 /Modules/regexpr.c | |
parent | 142eeb8339e4f3bcf40765377a1856bcc9a5ea66 (diff) | |
download | cpython-52d6832554d7bd4ba4f24b8b50431ea3da70708c.zip cpython-52d6832554d7bd4ba4f24b8b50431ea3da70708c.tar.gz cpython-52d6832554d7bd4ba4f24b8b50431ea3da70708c.tar.bz2 |
Add syntax for hex,octal
Diffstat (limited to 'Modules/regexpr.c')
-rw-r--r-- | Modules/regexpr.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/Modules/regexpr.c b/Modules/regexpr.c index 2d30171..663e1de 100644 --- a/Modules/regexpr.c +++ b/Modules/regexpr.c @@ -486,7 +486,13 @@ void re_compile_initialize(void) for (a = 'A'; a <= 'Z'; a++) re_syntax_table[a] = Sword; for (a = '0'; a <= '9'; a++) - re_syntax_table[a] = Sword | Sdigit; + re_syntax_table[a] = Sword | Sdigit | Shexdigit; + for (a = '0'; a <= '7'; a++) + re_syntax_table[a] |= Soctaldigit; + for (a = 'A'; a <= 'F'; a++) + re_syntax_table[a] |= Shexdigit; + for (a = 'a'; a <= 'f'; a++) + re_syntax_table[a] |= Shexdigit; re_syntax_table['_'] = Sword; for (a = 9; a <= 13; a++) re_syntax_table[a] = Swhitespace; |