限制input只能输入1到10000之间的整数,求一个正则表达式

2025-03-14 01:34:00
推荐回答(2个)
回答1:

^[1-9]+([0-9]*){0,999}$

//start with 1-9 and continue with 0-9 from 0 to 999 times

//if you pleased with my answer ,please accept it

回答2:

^[1-9]\d{0,3}|10000$