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 class range spanning / or \ doesn't match it, and the negated class does: [.-0] misses "/", [!A-z] matches "\" #157
MaskPathSeparators (TextFilter/TextFilter.cs:420-421) replaces every literal / and \ with U+E000. It runs on both the pattern and the text before DotNet.Glob matches them (lines 425 and 529).
A character-class range covers / or \ only implicitly, through its endpoints, so masking never touches it. Once masked, the text holds U+E000, which no ASCII range contains.
Failure scenario
Probed with TextFilter.IsMatch(text, pattern, TextFilterType.Glob, TextFilterMatchOptions.ByWholeString):
Pattern
Text
Actual
Expected
[.-0] (U+002E–U+0030)
/
false
true
[!.-0]
/
true
false
[A-z] (U+0041–U+007A)
\
false
true
[!A-z]
\
true
false
Controls behave as expected: [A-z] matches _, and the regex ^v[ -/]1$ matches v/1.
The results are wrong in both directions, with no error. A negated class meant to exclude path characters ends up selecting them.
When masking the pattern, give any [...] class whose range spans / or \ the masked character as an extra member. Alternatively, expand ranges that cross a separator before masking.
Add tests for each row of the table above, including the negated forms.
Priority: Medium. Matches are silently wrong in both directions. A negated class meant to exclude path characters selects them, which can misroute a filter. The trigger is narrow, though: it needs a class range whose endpoints straddle / (U+002F) or \ (U+005C).
Area:TextFilter/TextFilter.csMaskPathSeparators and the glob pattern preparation that runs before DotNet.Glob
Next step: land Match every member of a glob class that mixes a range with other characters [patch] #156 first, then make sure class expansion runs before MaskPathSeparators. Also handle any remaining native range that spans / or \ by adding the masked character as an extra member. Add a test for each row of the issue's table, including the negated forms.
Activity
matt-edmondson commentedon Oct 29, 2026
Triage
/(U+002F) or\(U+005C).TextFilter/TextFilter.csMaskPathSeparatorsand the glob pattern preparation that runs before DotNet.Glob1/2also matches1\2, and excluding-*/*also hidesC:\temp:/and\are masked to the same character #132, 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, Since the trailing-dash fix (6937eb9), [a-z-] no longer matches "q", file[0-9a-] no longer matches "file5", and []a-] matches nothing #153)1/2also matches1\2, and excluding-*/*also hidesC:\temp:/and\are masked to the same character #132 (separator masking) but a different symptom. Open PR Match every member of a glob class that mixes a range with other characters [patch] #156 (ExpandGlobClasses, fixes 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/Since the trailing-dash fix (6937eb9), [a-z-] no longer matches "q", file[0-9a-] no longer matches "file5", and []a-] matches nothing #153) overlaps partly. It expands mixed classes into explicit lists, so a class like[.-0]could be fixed if the expansion runs before masking. It deliberately leaves a lone two-letter range such as[A-z]for DotNet.Glob to match natively, so the\cases would stay broken. Nothing open fully covers this.MaskPathSeparators. Also handle any remaining native range that spans/or\by adding the masked character as an extra member. Add a test for each row of the issue's table, including the negated forms.Generated by Claude Code
Move the #157 tests away from the lines #158's tests add to