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.
当我想测试输入字符串的长度是否至少为 10 且最多为 13 时,我使用以下模式:[0-9]{10,13}
[0-9]{10,13}
但是你将如何测试字符串长度是 10 还是 13 并且介于两者之间?
编辑:我看到两个主要的解决方案:
1) 使用 length1 OR length2 2) 使用 length1 + (length2 - length1) 的可选字符
只是想知道:两者之间是否有任何性能差异?
另一种选择是
^[0-9]{10}(?:[0-9]{3})?$
正则表达式101演示
使用这个表达式^((?:\d{3}){3,4}\d)$
^((?:\d{3}){3,4}\d)$
I want to pass one JBSearchRequest object which contains List<JBCredential> to my asp.net web service. I am able to call this web service from SOAP UI and s
JBSearchRequest
List<JBCredential>