Regex for number check below a value

前端 未结 6 1431
-上瘾入骨i
-上瘾入骨i 2020-12-11 05:54

I\'m still a beginner at regex so this is a little above me currently.

I need to validate a number input to two characters and it can\'t be more than the value 12.

6条回答
  •  再見小時候
    2020-12-11 06:32

    0[0-9]|1[0-2]

    Description:
    
     [0-9] : number between 00 and 09
         | : or
    1[0-2] : and if starting with 1, next number should be between 0 -1 (testing 10-12)
    

提交回复
热议问题