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.
-Dman100-Software ConsultantAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
ozoConnect With a Mentor Commented:
/^[0-9]{4,6}$/
0
 
-Dman100-Software ConsultantAuthor Commented:
Thank you!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.