I do not understand why the regex pattern containing the \\d
character class does not work but [0-9]
does. Character classes, such as \\s
Trying either pattern in a strictly POSIX environment will likely end up having no matches; if you want to make the pattern truly POSIX compatible use all bracket expressions:
const char *rstr = "^[[:digit:]]+[[:space:]]+[[:alpha:]]+[[:space:]]+[[:digit:]]+[[:space:]]+[[:alpha:]]+$";
↳ POSIX Character_classes