Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
什么是编写正则表达式的正确语法,该表达式限制用户仅输入介于以下范围内的整数:15 到 764 提前谢谢!
使用以下正则表达式
^(1[5-9]|[2-9]\d|[1-6]\d\d|7[0-5]\d|76[0-4])$
1[5-9]
[2-9]\d
[1-6]\d\d
7[0-5]\d
76[0-4]
\如果您在字符串文字中使用模式,请转义。
\
"^(1[5-9]|[2-9]\\d|[1-6]\\d\\d|7[0-5]\\d|76[0-4])$"