\d
matches a single digit, so \d\d
matches exactly 2. If you wanted exactly 3, you could write \d{3}
, for example. The documentation tells you the syntax, so you should go there to see what things are possible.Then, there are regular expression testers, e.g. https://pythex.org/ where you can try them out.