Regular expression for number with length of 4, 5 or 6
Solution 1:
Try this:
^[0-9]{4,6}$
{4,6}
= between 4 and 6 characters, inclusive.
Solution 2:
[0-9]{4,6}
can be shortened to \d{4,6}
Try this:
^[0-9]{4,6}$
{4,6}
= between 4 and 6 characters, inclusive.
[0-9]{4,6}
can be shortened to \d{4,6}