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
According to the POSIX regular expression spec:
An ordinary character is any character in the supported character set, except for the ERE special characters listed in ERE Special Characters. The interpretation of an ordinary character preceded by a backslash ( '\' ) is undefined.
So the only characters that can legally follow a \ are:
\^ \. \[ \$ \( \) \|
\* \+ \? \{ \\
all of which match the escaped character literally. Trying to use any of of the other PCRE extensions may not work.