regcomp.c:regprop: [bracketize] \w..., add \v
authorKarl Williamson <public@khwilliamson.com>
Thu, 6 Dec 2012 16:20:51 +0000 (09:20 -0700)
committerKarl Williamson <public@khwilliamson.com>
Sun, 9 Dec 2012 16:47:18 +0000 (09:47 -0700)
This function returns the name of a character class given its number.
This changes the name of \w, \s, \d to be [\w] ....  And it adds an
entry for \v and \V.  These makes a complete set, and will make things
easier to read, as a result of changes coming in future commits

regcomp.c

index 4736bbd..6784ad3 100644 (file)
--- a/regcomp.c
+++ b/regcomp.c
@@ -13822,12 +13822,12 @@ Perl_regprop(pTHX_ const regexp *prog, SV *sv, const regnode *o)
 
     /* Should be synchronized with * ANYOF_ #xdefines in regcomp.h */
     static const char * const anyofs[] = {
-        "\\w",
-        "\\W",
-        "\\s",
-        "\\S",
-        "\\d",
-        "\\D",
+        "[\\w]",
+        "[\\W]",
+        "[\\s]",
+        "[\\S]",
+        "[\\d]",
+        "[\\D]",
         "[:alnum:]",
         "[:^alnum:]",
         "[:alpha:]",
@@ -13851,7 +13851,9 @@ Perl_regprop(pTHX_ const regexp *prog, SV *sv, const regnode *o)
         "[:space:]",
         "[:^space:]",
         "[:blank:]",
-        "[:^blank:]"
+        "[:^blank:]",
+        "[\\v]",
+        "[\\V]"
     };
     RXi_GET_DECL(prog,progi);
     GET_RE_DEBUG_FLAGS_DECL;