It looks like the \d special pattern characters are not recognized by the REGEX Dialplan Function
same => n, Verbose(1,${REGEX("\\w" 7000)})
same => n, Verbose(1,${REGEX("\\d" 7000)})
same => n, Verbose(1,${REGEX("[[:digit:]]" 7000)})
-- Executing [7000@test:2] Verbose("Message/ast_msg_queue", "1,1") in new stack
1
-- Executing [7000@test:3] Verbose("Message/ast_msg_queue", "1,0") in new stack
0
-- Executing [7000@test:4] Verbose("Message/ast_msg_queue", "1,1") in new stack
1
same => n, Verbose(1,${REGEX("[[:alnum:]]" 7000)})
same => n, Verbose(1,${REGEX("[[:digit:]]" 7000)})
same => n, Verbose(1,${REGEX("[[:digit:]]" 7000)})
Sorry, my mistake! I’ve had the same problem before, and I just got excited and wrote it as soon as I saw the regex.
REGEX function uses POSIX regular expressions, which have slightly different syntax and rules compared to other regular expression engines. The \d and \w shortcuts are not recognized by POSIX, which is why your second REGEX check fails.