这是我的正则表达式
((?:(?:'[^']*')|[^;])*)[;]
它在分号上标记字符串。例如,
Hello world; I am having a problem; using regex;
结果是三个字符串
Hello world
I am having a problem
using regex
但是当我使用较大的输入字符串时,会出现此错误
Exception in thread "main" java.lang.StackOverflowError
at java.util.regex.Pattern$GroupHead.match(Pattern.java:4168)
at java.util.regex.Pattern$Loop.match(Pattern.java:4295)
at java.util.regex.Pattern$GroupTail.match(Pattern.java:4227)
at java.util.regex.Pattern$BranchConn.match(Pattern.java:4078)
at java.util.regex.Pattern$CharProperty.match(Pattern.java:3345)
at java.util.regex.Pattern$Branch.match(Pattern.java:4114)
at java.util.regex.Pattern$GroupHead.match(Pattern.java:4168)
at java.util.regex.Pattern$Loop.match(Pattern.java:4295)
at java.util.regex.Pattern$GroupTail.match(Pattern.java:4227)
这是怎么引起的,我该如何解决?
幕布斯6054654
郎朗坤
慕虎7371278
相关分类