Regular Expression for Range (2-16)

后端 未结 5 2018
臣服心动
臣服心动 2021-02-05 06:45

I want to match a number between 2-16, spanning 1 digit to 2 digits.

Regular-Expressions.info has examples for 1 or 2 digit ranges, but not something that spans both:

5条回答
  •  别那么骄傲
    2021-02-05 07:13

    ^([2-9]|1[0-6])$
    

    will match either a single digit between 2 and 9 inclusive, or a 1 followed by a digit between 0 and 6, inclusive.

提交回复
热议问题