Search Regex
search.regexSearch indexed workspace files for ECMAScript regular expression matches, using sparse n-gram pruning for fast candidate filtering and deterministic verification.
Instructions
Find ECMAScript regular-expression matches in indexed workspace files using sparse n-gram pruning before deterministic verification.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| flags | No | ECMAScript regex flags such as `gm` or `u`. Ignore-case searches fall back to a full scan. | |
| pattern | Yes | ECMAScript regular expression source without surrounding slashes. | |
| pathGlobs | No | Optional relative glob patterns that narrow the search to specific folders or files. | |
| afterLines | No | Number of context lines to include after each match. Defaults to 1. | |
| maxResults | No | Maximum number of matches to return. Defaults to 100. | |
| beforeLines | No | Number of context lines to include before each match. Defaults to 1. | |
| includePlan | No | Include the query plan explanation in the structured result. | |
| workspaceRoot | No | Absolute workspace root to search. Defaults to the server workspace. | |
| autoEnsureIndex | No | Refresh the local index automatically before searching. Defaults to true. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| plan | No | ||
| matches | Yes | ||
| elapsedMs | Yes | ||
| queryKind | Yes | ||
| truncated | Yes | ||
| matchCount | Yes | ||
| plannerMode | No | ||
| fallbackReason | No | ||
| scannedDocCount | Yes | ||
| candidateDocCount | Yes | ||
| coveringGramCount | No | ||
| extractableAnchors | No |