我需要将一些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))*\))
^