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.
asRuleValue 是[^0-9a-zA-Z"'-.#, ]
[^0-9a-zA-Z"'-.#, ]
Pattern classPattern = Pattern.compile(asRuleValue, Pattern.CASE_INSENSITIVE); Matcher m = classPattern.matcher(asValue); if (!m.find()) { lbFlag = true; }
在某些情况下无法正常工作,例如()我在这里做错了什么?
()
你需要-在你的角色类中转义或者把它放到最后。
-
采用:
[^0-9a-zA-Z"'.#, -]
否则,您正在创建一个字符范围从'到.还包括()*+,
'
.
()*+,