Open
Description
I want to match the following pattern:
C:\Users\*\path\to\program.exe
I expect it to match with
C:\Users\hedwigz\path\to\program.exe
but shouldn't match with:
C:\Users\hedwigz\another\path\to\program.exe
But feeding this straight to glob pattern does not work as I expected
fn matches_wildcard(&self, path: &str, wildcard: &str) -> bool {
if let Ok(pattern) = Pattern::new(wildcard.to_ascii_lowercase().as_str()) {
pattern.matches(path.to_ascii_lowercase().as_str())
} else {
false
}
}
What is the correct approach here?
Thanks
Metadata
Metadata
Assignees
Labels
No labels