Skip to content

Commit 8e0e737

Browse files
fix(web): content: filter now respects regex mode (#947)
* fix(web): ContentExpr now respects isRegexEnabled flag in query parser Previously, content: prefix filters always used substring matching regardless of the regex toggle, so patterns like content:next-auth.*beta searched for the literal string "next-auth.*beta" rather than treating it as a regex. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * changelog Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent da26b90 commit 8e0e737

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
99

1010
### Fixed
1111
- Fixed search query parser rejecting parenthesized regex alternation in filter values (e.g. `file:(test|spec)`, `-file:(test|spec)`). [#946](https://github.com/sourcebot-dev/sourcebot/pull/946)
12+
- Fixed `content:` filter ignoring the regex toggle. [#947](https://github.com/sourcebot-dev/sourcebot/pull/947)
1213

1314
## [4.12.0] - 2026-02-26
1415

packages/web/src/features/search/parser.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,15 @@ const transformTreeToIR = async ({
272272
};
273273

274274
case ContentExpr:
275-
return {
275+
return isRegexEnabled ? {
276+
regexp: {
277+
regexp: value,
278+
case_sensitive: isCaseSensitivityEnabled,
279+
file_name: false,
280+
content: true
281+
},
282+
query: "regexp"
283+
} : {
276284
substring: {
277285
pattern: value,
278286
case_sensitive: isCaseSensitivityEnabled,

0 commit comments

Comments
 (0)