skip to Main Content

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

Answers


  1. 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}

    Login or Signup to reply.
  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

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search