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; break;
case 'w': /* word */ case 'w': /* word */
//cprintf(cb, "[0-9a-zA-Z_\\\\-]") //cprintf(cb, "[0-9a-zA-Z_\\\\-]")
cprintf(cb, "[^[:punct:][:space:][:cntrl:]]"); cprintf(cb, "[[:alnum:]|_]");
break; break;
case 'W': /* inverse of \w */ case 'W': /* inverse of \w */
cprintf(cb, "[[:punct:][:space:][:cntrl:]]"); cprintf(cb, "[^[[:alnum:]|_]]");
break; break;
default: default:
cprintf(cb, "\\%c", x); cprintf(cb, "\\%c", x);