Perl到Groovy正则表达式转换

时间:2017-01-16 11:54:26

标签: regex perl groovy

我需要将一些perl正则表达式转换为Groovy正则表达式:

$ddl =~ s/\bLOB.+?STORE\s+AS\s+(?:SECUREFILE\s+)?(\((?:[^\(\)]++|(?1))*\))//gsx;

我试图使用:

ddl = ddl.replaceAll(/(?sx)\bLOB.+?STORE\s+AS\s+(?:SECUREFILE\s+)?(\((?:[^()]++|(?1))*\))/, "")

但它会引发异常:

Exception in thread "main" java.util.regex.PatternSyntaxException: Unknown inline modifier near index 72
(?sx)\bLOB.+?STORE\s+AS\s+(?:SECUREFILE\s+)?(\((?:[^\(\)]++|(?1))*\))
                                                              ^

0 个答案:

没有答案