Skip to content

Split filters and text on all whitespace, not only ' ' - #116

Merged
matt-edmondson merged 2 commits into
mainfrom
claude/textfilter-112-non-space-whitespace
Sep 27, 2026
Merged

matt-edmondson merged 2 commits into
mainfrom
claude/textfilter-112-non-space-whitespace

Conversation

@matt-edmondson

Copy link
Copy Markdown
Contributor

Fixes #112

What changed

ExtractTextTokens and ExtractGlobFilterTokens split on ' ' and then trimmed each piece. A piece made only of other whitespace (tab, CR/LF, NBSP) got past RemoveEmptyEntries and then trimmed down to "". Both now split on all whitespace with Split((char[]?)null, RemoveEmptyEntries), so an empty token can't come out of either one.

Tests

  • GlobWithNonSpaceWhitespaceDoesNotThrow, RegexByWordAllIgnoresNonSpaceWhitespaceBetweenWords and RegexByWordAllDoesNotMatchTextOfOnlyNonSpaceWhitespace failed before the fix (7 failures) and pass after it.
  • Full suite: 113/113 passing locally on net10.0.

#113, the ByWholeString optional-token combinator, is in the same area but will go in its own PR.

🤖 Generated with Claude Code

https://claude.ai/code/session_01SZUfnvhMFzj96bfFNzbfpn


Generated by Claude Code

A chunk of other whitespace (tab, CR/LF, NBSP) between spaces survived
RemoveEmptyEntries and then trimmed to an empty token. The glob tokenizer
read its first character and threw, and regex ByWordAll saw a phantom
empty word, which also undid the blank-text guard from #107.

Fixes #112

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SZUfnvhMFzj96bfFNzbfpn
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SZUfnvhMFzj96bfFNzbfpn
@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Whitespace other than ' ' (tab, CR/LF, NBSP) makes glob IsMatch/Filter throw and makes regex ByWordAll see phantom empty words

2 participants