fix posix regular transform of char \w not include '_' char

This commit is contained in:
jiangxiaoming 2022-08-25 11:41:16 +08:00
parent a516ee173d
commit b73cc75366

View file

@ -181,10 +181,10 @@ regexp_xsd2posix(char *xsd,
break;
case 'w': /* word */
//cprintf(cb, "[0-9a-zA-Z_\\\\-]")
cprintf(cb, "[^[:punct:][:space:][:cntrl:]]");
cprintf(cb, "[[:alnum:]|_]");
break;
case 'W': /* inverse of \w */
cprintf(cb, "[[:punct:][:space:][:cntrl:]]");
cprintf(cb, "[^[[:alnum:]|_]]");
break;
default:
cprintf(cb, "\\%c", x);