I have a case that I only care about the maximum number. For instance, consider that I have to simply check that the string is: "max of 10 numeric digits", which means that it should meet the following:
- It contains only numbers (resolved).
- It has to be 10 digits at maximum.
I read about limiting the length, I came up with the following result:
^\d{10}$
: all numerics, 10 numbers specifically.^\d{10,20}$
: all numerics, 10 - 20 length.^\d{10,}$
: all numerics, 10 at minimum.
However, ^\d{,10}$
is invalid! Is there a specific way to do it, or should I do it as ^\d{1,10}$
?