DotNet.Glob
DotNet.Glob copied to clipboard
Composite character ranges
At the moment dotnet.glob supports either number or letter ranges in patterns, e.g
-
[A-Z]
-
[1-9]
However the Unix etc glob library supports a composite form of range expression:
[A-Fa-f0-9]
Ranges
There is one special convention: two characters separated by '-'
denote a range. (Thus, "[A-Fa-f0-9]" is equivalent to
"[ABCDEFabcdef0123456789]".) One may include '-' in its literal
meaning by making it the first or last character between the
brackets. (Thus, "[]-]" matches just the two characters ']' and
'-', and "[--0]" matches the three characters '-', '.', '0',
since '/' cannot be matched.)
Support for this could be implemented, and as far as I can see it wouldn't introduce any breaking behavioural changes as people don't have to use this pattern. I would perhaps implement new range tokens for this extended form