diff --git a/vassal-app/src/main/java/VASSAL/configure/ConfigureTree.java b/vassal-app/src/main/java/VASSAL/configure/ConfigureTree.java index e9600f3e98..c3fa4eab04 100644 --- a/vassal-app/src/main/java/VASSAL/configure/ConfigureTree.java +++ b/vassal-app/src/main/java/VASSAL/configure/ConfigureTree.java @@ -2193,7 +2193,7 @@ public void actionPerformed(ActionEvent e) { // Compute & display hit count as heading, no indent final int matches = getNumMatches(searchParameters.getSearchString()); // FIXME: For some reason leading spaces now being stripped from Resource strings, hence added here - chatter.show("" + matches + " " + (regexPattern == null ? Resources.getString("Editor.search_count") : Resources.getString("Editor.search_countRegex")) + ": " + noHTML(regexPattern == null ? searchParameters.getSearchString() : regexPattern.toString())); + chatter.show(matches + " " + (regexPattern == null ? Resources.getString("Editor.search_count") : Resources.getString("Editor.search_countRegex")) + ": " + noHTML(regexPattern == null ? searchParameters.getSearchString() : regexPattern.toString())); } } @@ -2702,11 +2702,10 @@ private Pattern setupRegexSearch(String searchString) { // If the string contains no Regex operands, establish a useful default // FIXME: escape characters will be interpreted as regex, bypassing the default. This may be ok anyway. - if (!searchString.matches("\\[a-zA-Z]|\\*|\\.|\\?|\\^|\\$|\\(.*?\\)|\\[.*?\\]|\\{.*?\\}|\\|")) { try { - regexSearchString = ".*\\b" + searchString + "?"; - Pattern.compile(regexSearchString); // test + Pattern.compile(".*\\b" + regexSearchString + ".*?"); // test default + regexSearchString = ".*\\b" + regexSearchString + ".*?"; // accept default chat(Resources.getString("Editor.search_regexDefault") + noHTML(searchString)); // NON-NLS } catch (java.util.regex.PatternSyntaxException e) {