Try this:
^[0-9]{4,6}$
{4,6}
= between 4 and 6 characters, inclusive.
More Related Contents:
- Find list of strings that matches a pattern that start with a special character « and end with a special character »
- Remove text between two parenthesis, if two more parenthesis [closed]
- Javascript Regex for decimal [duplicate]
- How to replace plain URLs with links?
- Regular expression to get a string between two strings in Javascript
- Regex to get string between curly braces
- Validate phone number with JavaScript
- What is the meaning of the ‘g’ flag in regular expressions?
- What is the difference between RegExp’s exec() function and String’s match() function?
- Is there a version of JavaScript’s String.indexOf() that allows for regular expressions?
- Remove HTML Tags in Javascript with Regex
- Remove whitespace and line breaks between HTML elements using jQuery
- How to replace last occurrence of characters in a string using javascript
- Validating user’s UTF-8 name in Javascript
- regular expression to match exactly 5 digits
- Syntax error in IE using ES6 arrow functions
- Javascript regular expression to validate URL
- Split a string by whitespace, keeping quoted segments, allowing escaped quotes
- How to wrap part of a text in a node with JavaScript
- Increment a number in a string in with regex
- Insert dash after every 4th character in input
- Insert space before capital letters
- how to use dotall flag for regex.exec()
- regular expression for finding decimal/float numbers?
- regex pattern to match the end of a string
- Extract parameter value from url using regular expressions
- RegEx Ignore Case
- Javascript Regular Expression for rgb values
- Regex that matches anything except for all whitespace
- How to escape backslash in JavaScript?