A digit is
\d
. A repetition can be implemented using
{N}
(meaning that a char or group must be repeated N times). With that, your regex becomes:
^\d{3}/[A-Z]{2}\d{2}/\d{9}/\d{2}$
Test it here:
Online regex tester and debugger: PHP, PCRE, Python, Golang and JavaScript[
^]
string regex = @"^\d{3}/[A-Z]{2}\d{2}/\d{9}/\d{2}$";
Note the
@
before the string; it makes the string a verbatim string literal so you don't have to escape the backslashes.