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.
Features
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.
Commands
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).
Configuration
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
Requirements
VS Code ≥ 1.109.0
GitHub Copilot extension (for Language Model API access)
An active Copilot subscription / authorization
Privacy
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 (find or findReplace)
No file contents beyond the explicit selection are sent. No data is stored or transmitted outside the VS Code Language Model API flow.
Known Limitations
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 preserveCase flag depends on VS Code's Find widget support.
Roadmap
[ ] 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
Local Development
# Install dependencies
pnpm install
# Compile
pnpm run compile
# Watch mode
pnpm run watch
# Lint
pnpm run lint
# Run tests
pnpm run test