Skip to content

Commit

Permalink
Corrected regular expression pattern escaping
Browse files Browse the repository at this point in the history
  • Loading branch information
jan-molak committed Dec 30, 2023
1 parent 665e8f6 commit bd3b06e
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public class SearchForFilesOfType extends SimpleFileVisitor<Path> {
int maxDepth;

public SearchForFilesOfType(Path root, String suffix) {
this(root, Pattern.compile(".*" + suffix + "\\$"));
this(root, Pattern.compile(".*" + Pattern.quote(suffix) + "$"));
}

public SearchForFilesOfType(Path root, Pattern pattern) {
Expand Down

0 comments on commit bd3b06e

Please sign in to comment.