4

I want a regular expression that accepts numeric only between 15 to 17 digits.

1 Answer 1

7

^\d{15,17}$ - For any digit (use [0-9] instead of \d to avoid Unicode characters, if applicable).
^[1-9]\d{14,16}$ - If you don't want the number to start with all zeros.

Of course, it might be easier to parse the number and check it, it fits nicely in a long value.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.