MATCHES_REGEX problems with "\d" to detect any digits

I want to use the following RegEx to check RFC (Mexican ID for Tax payment)

^[A-ZÑ&]{3,4}\d{6}(?:[A-Z\d]{3})?$

But it seems that the compiler doesn’t like teh backslash “”

Any solutions ??

I have tested my regular expresion in regex101.com without problems

1 Like

You probably have to escape the backslashes
\d should be \\d

^[A-ZÑ&]{3,4}\\d{6}(?:[A-Z\\d]{3})?$

1 Like

Totally correct. Thanks