[英]java.util.regex.PatternSyntaxException: Unclosed character class near index 12 \\b]([^.(|[]+)
Unclosed character class near index 12 \\b]([^.(|[]+) ^ 索引12附近的未封闭字符类\\ b]([^。(| [] +)^
The regex above works fine, however it does not work on java and i cant detect what is the problem that causing it. 上面的正则表达式工作正常,但是在Java上不起作用,并且我无法检测到导致它的问题是什么。
Could someone help me? 有人可以帮我吗?
Thanks in advance 提前致谢
您需要避免像\\b\\\\]\\\\(\\\\[^.(|\\\\[\\\\]+)
这样的开括号和闭括号\\b\\\\]\\\\(\\\\[^.(|\\\\[\\\\]+)
我相信这只是您剩余的正则表达式,而不是整个正则表达式),因为您指定了方括号内的元字符,在定义正则表达式时具有特殊含义。
To make the regex working in Java use: \\b\\]([^.(|\\[]+)
要使正则表达式在Java中工作,请使用:
\\b\\]([^.(|\\[]+)
The Java Regex String is: Java Regex字符串为:
"\\b\\]([^.(|\\[]+)"
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.