I am trying to exclude no between 139 to 199.
All the other values from 000 to 138 and 200 to 999 are acceptable
2
You can write out the 000-099, 100-129, 130-138, 200-999 cases separately and then OR them
0[0-9]{2}|1[0-2][0-9]|13[0-8]|[2-9][0-9]{2}
You can use this regex:
^[02-9][0-9]{2}|1[0-2][0-9]|13[0-8]$
https://regex101.com/r/ewPi9U/1
Click here to cancel reply.
2
Answers
You can write out the 000-099, 100-129, 130-138, 200-999 cases separately and then OR them
0[0-9]{2}|1[0-2][0-9]|13[0-8]|[2-9][0-9]{2}
You can use this regex:
https://regex101.com/r/ewPi9U/1