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

前端 未结 5 1216
天涯浪人
天涯浪人 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:08

    You have two classes of numbers you want to match:

    • the digit 2, followed by one of the digits between 3 and 9
    • one of the digits between 3 and 7, followed by any digit

    Edit: Well, that's the title's range (23-79). Within your question (23-75), you have three:

    • the digit 2, followed by one of the digits between 3 and 9
    • one of the digits between 3 and 6, followed by any digit
    • the digit 7, followed by one of the digits between 0 and 5

提交回复
热议问题