From 81fb77e9bcf73491c6cf604c5d11cdea11b34c85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9E=97=E4=B8=87=E7=A8=8B?= <1498425439@qq.com> Date: Thu, 28 Apr 2022 01:45:20 +0800 Subject: [PATCH] put NOT first only group not null --- .../java/io/github/linwancen/plugin/show/ext/LineExt.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/io/github/linwancen/plugin/show/ext/LineExt.java b/src/main/java/io/github/linwancen/plugin/show/ext/LineExt.java index 40e1f14..6ae48bf 100644 --- a/src/main/java/io/github/linwancen/plugin/show/ext/LineExt.java +++ b/src/main/java/io/github/linwancen/plugin/show/ext/LineExt.java @@ -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 + " = '"); }