Closed MarkMichaelis closed 7 years ago
Currently the non-alphanumeric characters that are supported are restricted to this subset: https://github.com/dazinator/DotNet.Glob/blob/develop/src/DotNet.Glob/GlobStringReader.cs#L27
These characters are ones that are legal for file / directory paths.
Are you looking to match text within a text file or something?
I was looking to find the equivalent of the Visual Basic or PowerShell like operators so yes. :)
As per #31 - the issue is that when the pattern is tokenised, if the pattern contains a character that isn't in the allowed / supported subset of characters, then the token is silently omitted from the tokenised pattern. Then when you go on to do a match, you are actually matching now against a pattern that has those unsupported tokens omitted.
I am thinking I can address this in a couple of ways.
The current constraints on the characters you can use are optimised for path / directory matching. Having an option to relax these constraints will allow you to use DotNet.Glob in a fashion more similar to VB's Like.
I have just pushed 1.6.4
which fixes this problem!
Read: https://github.com/dazinator/DotNet.Glob#parsing-options
It appers that a patterns with escape sequences fail:
DotNet.Globbing.Glob.Parse("\"Stuff*").IsMatch("\"Stuff")
: falseDotNet.Globbing.Glob.Parse("\0Stuff*").IsMatch("\0Stuff")
: falseDotNet.Globbing.Glob.Parse("\nStuff*").IsMatch("\nStuff")
: falseDotNet.Globbing.Glob.Parse("\r\nStuff*").IsMatch("\r\nStuff")
: false