Skip to content

Commit

Permalink
Regex search string patch.
Browse files Browse the repository at this point in the history
  • Loading branch information
riverwanderer committed Sep 18, 2023
1 parent 1bb6759 commit 71932d0
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions vassal-app/src/main/java/VASSAL/configure/ConfigureTree.java
Original file line number Diff line number Diff line change
Expand Up @@ -2662,6 +2662,10 @@ else if (c instanceof PrototypeDefinition) {
*/
private boolean checkString(String target, String searchString) {
if (searchParameters.isMatchRegex()) {
// patch search string to avoid exception when Regex starts with * only
if (searchString.substring(0,1) == "*") {
searchString = "." + searchString;
}
if (searchParameters.isMatchCase()) {
return target.matches(searchString);
}
Expand Down

0 comments on commit 71932d0

Please sign in to comment.