I need a regular expression to find a number in the range [40010-40100]. I tried with this 40[0-1][0-9][0-9]
but it doesn't work. Could someone help me?
Asked
Active
Viewed 533 times
4
-
9This is not a good use of regular expressions. What scripting language are you using? – Jason McCreary May 16 '11 at 14:05
-
possible duplicate of [Regular Expression: Numeric range](http://stackoverflow.com/questions/1377926/regular-expression-numeric-range) – Marijn Jun 14 '12 at 08:37
4 Answers
1
Try the following
40((0[1-9][0-9])|(100))
Although this is not a great task for a regular expression. It would be much easier to simply do a range comparison on the number

JaredPar
- 733,204
- 149
- 1,241
- 1,454
1
/400[1-9][0-9]|40100/
Why oh why can't I just post the answer without an "Oops!"?

e.dan
- 7,275
- 1
- 26
- 29