Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 73
  • Last Modified:

validate input field is 4, 5 or 6 digits

I have the following regular expression:

/^[0-9]{4,5}$/

Open in new window


This validates that an input field only accepts 4 or 5 digits as the input.  I need to change it to accept either 4, 5 or 6 digits now.  

I tried the following:

/^[0-9]{4,5,6}$/

Open in new window


This did not work.

Any help is appreciated.
Thanks.
0
-Dman100-
Asked:
-Dman100-
1 Solution
 
ozoCommented:
/^[0-9]{4,6}$/
0
 
-Dman100-Author Commented:
Thank you!
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now