put NOT first only group not null

This commit is contained in:
林万程
2022-04-28 01:45:20 +08:00
parent baeaf71d18
commit 81fb77e9bc

View File

@@ -53,7 +53,9 @@ public class LineExt {
}
String key = matcher.group(1);
// put NOT first
text = matcher.replaceAll(" $2 ( $1 = '");
if (matcher.group(2) != null) {
text = matcher.replaceAll(" $2 ( $1 = '");
}
// add key after AND/OR
return AND_OR_PATTERN.matcher(text).replaceAll("$1 " + key + " = '");
}