dazinator / DotNet.Glob

A fast globbing library for .NET / .NETStandard applications. Outperforms Regex.
MIT License
363 stars 27 forks source link

*\** should match input string without any path separators #59

Closed dazinator closed 6 years ago

dazinator commented 6 years ago

Currently this match fails:

 var pattern = @"*\**"
 var glob = Globbing.Glob.Parse(pattern);
 var match = glob.IsMatch("foo");

This is because the \** is expecting t o start matching on a \ or /. So for example, it will currently match this:

 var match = glob.IsMatch("foo\");

However, I should cover the case where we want to match foo as well as foo\ or foo\var. Basically we want to match any path starting with foo whether it has zero or many path seperator's following foo. So foo\** should match foo as well as foo\ and foo\bar\baz :-)