AI-powered regex generation for VS Code Find & Replace.
ReFind lets you describe what you want to find (or find & replace) in plain language. It calls a language model to generate the regex, then applies it directly to VS Code's built-in Find widget — no copy-paste needed.
- Natural-language → Regex — Describe your intent; get a working regex.
- Find & Replace — Describe both what to find and how to replace in one step.
- One-click apply — Generated regex is applied directly to VS Code's Find/Replace widget via
editor.actions.findWithArgs. - Review before apply — Confirm, edit, or cancel the result before it hits your editor.
- Selection as context — Automatically uses the current editor selection as additional context for the model.
- Mock mode — Develop and test the full flow without a real model backend.
| Command | Description |
|---|---|
ReFind: Generate Find Regex |
Collect intent → generate regex → apply to Find widget |
ReFind: Generate Find & Replace Regex |
Same, but also generates a replacement string |
Access via Command Palette (Ctrl+Shift+P / Cmd+Shift+P).
| Setting | Type | Default | Description |
|---|---|---|---|
refind.useMock |
boolean |
false |
Use the mock generator instead of the Language Model API |
refind.autoApply |
boolean |
false |
Skip confirmation and apply regex directly to Find widget |
refind.defaultUseSelection |
boolean |
true |
Automatically offer to include editor selection as context |
- VS Code ≥ 1.109.0
- GitHub Copilot extension (for Language Model API access)
- An active Copilot subscription / authorization
When you use ReFind, the following data is sent to the language model:
- Your intent description (what you typed in the input box)
- Editor selection (if you confirmed its inclusion)
- The mode (
findorfindReplace)
No file contents beyond the explicit selection are sent. No data is stored or transmitted outside the VS Code Language Model API flow.
- The model may occasionally produce invalid or suboptimal regex patterns.
- Very complex regex requirements may need manual editing after generation.
- Only JavaScript-flavour regex is supported (VS Code's native engine).
- The
preserveCaseflag depends on VS Code's Find widget support.
- Multi-turn refinement ("make it also match X")
- Regex preview with live match highlighting
- History of recently generated patterns
- Support for multi-file search (
workbench.action.findInFiles) - Configuration for preferred model family
# Install dependencies
pnpm install
# Compile
pnpm run compile
# Watch mode
pnpm run watch
# Lint
pnpm run lint
# Run tests
pnpm run test# Install vsce if needed
npm install -g @vscode/vsce
# Package as VSIX
vsce package
# Install locally
code --install-extension refind-0.1.0.vsix