正则表达式:只能输入0~30,1~50的正整数

1~50正整数正则表达式

/^[1-4][0-9]$|^[5][0]$|^[1-9]$/

只能输入范围(0~30)

/^30$|^([1-2]\d)$|^\d?$/

只能输入范围(0~10)

/^[0-9]$|^[1][0]$|^[0-9]$/

猜你喜欢

转载自blog.csdn.net/qq_42080594/article/details/128845561