Skip to content

Commit

Permalink
正则表达式去掉冗余字符
Browse files Browse the repository at this point in the history
  • Loading branch information
zhoujia committed Nov 16, 2021
1 parent b68774c commit eca6463
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
1 change: 0 additions & 1 deletion src/main/java/cn/olange/ui/RulePreviewPanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,6 @@ public void updateLayoutLater(RuleModel row) {
this.setBorder(IdeBorderFactory.createTitledBorder(title, false, new JBInsets(8, 0, 0, 0)).setShowLine(false));
this.setToolTipText(title);
this.textArea.setText(rule);
this.checkTextArea.setToolTipText(examples);
this.checkTextArea.setText("");
this.exampleText.setText(examples);
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/cn/olange/utils/RuleUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ public static String convertRule(String rule) {
first = Math.max(first + 1, 0);
int lastIndexOf = rule.lastIndexOf("/");
lastIndexOf = Math.min(lastIndexOf, rule.length() -1);
return rule.substring(first, lastIndexOf);
return rule.substring(first, lastIndexOf).replace("[\\]", "");
}
}

0 comments on commit eca6463

Please sign in to comment.