9 个解决方案
#1
/^[0-9]|1[0-9]|2[0-3]$/
#2
/^\d$|^1\d$|^2[0-3]$/
#3
/^[0-9]|1[0-9]|2[0-3]$/
#4
支持
#5
var regex=/^(?:\d|(?:1\d)|(?:2[0-3]))$/;
#6
//换种写法
var regex=/^(?:(?:1?\d)|(?:2[0-3]))$/;
#7
多谢大家!
#8
123213123123213213123123wef wew
#9
123112
#1
/^[0-9]|1[0-9]|2[0-3]$/
#2
/^\d$|^1\d$|^2[0-3]$/
#3
/^[0-9]|1[0-9]|2[0-3]$/
#4
支持
#5
var regex=/^(?:\d|(?:1\d)|(?:2[0-3]))$/;
#6
//换种写法
var regex=/^(?:(?:1?\d)|(?:2[0-3]))$/;
#7
多谢大家!
#8
123213123123213213123123wef wew
#9
123112