[英]How to express REGEX OR in in digits?
\d{1,2}|\d{5,}
(\d{1,2})|(\d{5,})
I want to match 1-2 digits or more than 5 digits.我想匹配 1-2 位或 5 位以上的数字。 Why both patterns above not working?
为什么上面的两种模式都不起作用? I suppose this should match the second half:
我想这应该与下半场相匹配:
s = 12345
S is a digit, not str. S是一个数字,而不是str。 But it doesn't match at all.
但它根本不匹配。
\d{5,}|\d{1,2}
\d{5,}|\d{1,2}
^(?:\d{5,}|\d{1,2})$
^(?:\d{5,}|\d{1,2})$
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.