AI Regex Search is a VS Code extension that converts natural language descriptions into regular expressions using Google's Gemini AI. Simply describe the pattern you want to find, and let AI generate the perfect regex for your search.
To use the AI Regex Search extension:
- Get a Google Generative AI API key from Google AI Studio
- Set the API key in the extension settings to enable regex generation
- Use the command palette to convert your descriptions into regex patterns
- AI-Powered Regex Generation: Convert natural language descriptions into precise regular expressions
- VS Code Integration: Automatically opens search with the generated regex pattern
- Multiple AI Models: Choose from different Gemini models for optimal results
- Instant Search: Generated patterns are immediately ready to use in VS Code's search
- Pattern Validation: Ensures generated regex patterns are valid and VS Code-compatible
- User-Friendly: No regex expertise required - just describe what you want to find
- Visual Studio Code v1.60.0 or higher
- A Google Generative AI API key from Google AI Studio
- Active internet connection for AI pattern generation
-
Install and Setup:
- Install the extension from VS Code Marketplace
- Configure your Gemini API key in VS Code settings
- Optionally select your preferred Gemini model
-
Generate Regex Patterns:
- Open Command Palette (Ctrl+Shift+P / Cmd+Shift+P)
- Type "AI Regex Search: Convert AI Description to Regex"
- Enter your pattern description
- Watch as the AI generates your regex pattern
-
Search Your Code:
- The Find dialog opens automatically with your pattern
- Regex mode is enabled by default
- Navigate through matches in your code
This extension provides the following settings:
abdxdev.geminiApiKey
: Your Google Generative AI API keyabdxdev.geminiModel
: Model to use for pattern generation (default: gemini-2.0-flash-001)
Access these commands through the Command Palette (Ctrl+Shift+P / Cmd+Shift+P):
- AI Regex Search: Convert AI Description to Regex - Generate a regex pattern from your description
- abdxdev: Set Gemini API Key - Configure your API key
- Find email addresses in your codebase
- Search for specific URL patterns
- Locate phone numbers with various formats
- Find HTML tags with specific attributes
- Match dates in specific formats
- Search for function declarations
- Find variable naming patterns
Found a bug or have a suggestion? Please feel free to:
- Open an issue on GitHub
- Submit a pull request with your improvements
- Share your feedback and ideas
Find the source code and contribute on GitHub.