I don’t think regex is the right choice for this. Have you tried parsing the value? If you have to use regex I would match \d{1,3}
parse the string and then validate the number in code.
More Related Contents:
- Phone number regular expressions exact format
- Greedy vs. Reluctant vs. Possessive Qualifiers
- RegEx: Grabbing values between quotation marks
- Regular Expression to match valid dates
- In regex, match either the end of the string or a specific character
- How to match numbers between X and Y with regexp?
- Regex for Comma delimited list
- Exclude characters from a character class
- What’s the regular expression that matches a square bracket?
- Can you make just part of a regex case-insensitive?
- How does the regular expression ‘(?
- Regex to find repeating numbers
- How to ignore whitespace in a regular expression subject string?
- Regular expression search replace in Sublime Text 2
- Phone validation regex
- Regex for alphanumeric, but at least one letter
- Random Text generator based on regex [duplicate]
- Microsoft office Access `LIKE` VS `RegEx`
- Why are there so many different regular expression dialects?
- How to replace a whole line with sed?
- Unix grep regex containing ‘x’ but not containing ‘y’
- What regular expression can never match?
- is there something akin to regEx in applescript, and if not, what’s the alternative?
- Regular Expression Validation For Indian Phone Number and Mobile number
- Replace newlines with literal \n
- How to capture multiple regex matches, from a single line, into the $matches magic variable in Powershell?
- htaccess force https and redirect www to non-www, but no other subdomains
- Filtering a diff with a regular expression
- How to measure similarity between strings?
- “UnicodeEncodeError: ‘ascii’ codec can’t encode character”