You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Glob character classes that combine a range with anything else silently drop members: [0-9a-f] doesn't match "c", [a-zA-Z] doesn't match "Q", [a-z_] doesn't match "_" #152
DotNet.Glob 3.1.3 (pinned in Directory.Packages.props) turns a bracket class into exactly one token, of one of two kinds:
A single range (LetterRangeToken / NumberRangeToken). Everything after the first range is ignored.
A plain character list (CharacterListToken). Here - is just another member, and no ranges are read.
It never combines a range with other members. ResolveGlob (TextFilter/TextFilter.cs, ~L521-547) passes the tokens straight through and does nothing to make up for this. Nothing throws, so these patterns are not "unparseable and ignored". They just give wrong answers:
Pattern
DotNet.Glob reads it as
Consequence
[0-9a-f]
number range 0-9
c doesn't match
[a-zA-Z]
letter range a-z
Q doesn't match (case-sensitive)
[a-z_]
letter range a-z
_ doesn't match
[-0-9]
list -, 0, 9
5 doesn't match
[ab-d]
list a, b, -, d
c doesn't match
Repro (verified with tests through TextFilter.IsMatch, TextFilterType.Glob, ByWholeString)
Hex digits, both letter cases and identifier characters are among the most common things people put in a class. A user filtering with *[0-9a-f] or [a-zA-Z]* gets items silently hidden, with no error and no sign the pattern was misread.
Suggested fix / acceptance criteria
During token preprocessing (the same place as MoveTrailingClassDashes), rewrite every closed class that contains a range into an explicit character list.
For example, [0-9a-f] becomes [0123456789abcdef], and a leading ! negation is kept.
CharacterListToken already handles negation and case-insensitivity correctly.
Cap how large a range may expand, or reject ranges that are too large.
Notes: Very common classes ([0-9a-f], [a-zA-Z], [a-z_]) give wrong results with no error, so users lose matches without knowing it. Expanding range-bearing classes into explicit character lists, with a cap on expansion size, is the smaller fix. Translating to Regex is larger but also covers the timeout protection #131 asks for. Pick one and land it together with #153.
Activity
matt-edmondson commentedon Oct 23, 2026
Triage
TextFilter.ResolveGlob/ glob token preprocessing (DotNet.Glob 3.1.3 class handling)*-*-*-*-*-*-*xtakes ~6 s per item against an 80-dash line (56 s with one more*-): glob matching is exponential and, unlike regex, has no timeout #131 if you take the glob-to-Regex route. No open PR found.Notes: Very common classes (
[0-9a-f],[a-zA-Z],[a-z_]) give wrong results with no error, so users lose matches without knowing it. Expanding range-bearing classes into explicit character lists, with a cap on expansion size, is the smaller fix. Translating toRegexis larger but also covers the timeout protection #131 asks for. Pick one and land it together with #153.Generated by Claude Code