Regular Expression - Two Digit Range (23-79)?

前端 未结 5 1246
天涯浪人
天涯浪人 2021-02-15 18:31

I have been reading the regex questions on this site but my issue seems to be a bit different. I need to match a 2 digit number, such as 23 through 75. I am doing this on an H

5条回答
  •  佛祖请我去吃肉
    2021-02-15 19:03

    This should do it:

    /^([2][3-9]|[3-6][0-9]|[7][0-5])$/
    

    ^ and $ will make it strict that it will match only 2 numbers, so in case that you have i.e 234 it won't work.

提交回复
热议问题