Merge pull request #358 from nowaits/master

fix posix regular transform of char \w not include '_' char
This commit is contained in:
Olof Hagsand 2022-09-07 10:26:45 +02:00 committed by GitHub
commit 2d23c9656b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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);