Code · best for
Top picks for Regex Writing (2026)
Crafting regular expressions that actually match what you intend. Ranked from 335 live models on the OpenRouter catalog, weighted for reasoning quality, low cost.
What this is
Ranked by capability match + real benchmark scores (Aider Polyglot, Artificial Analysis Intelligence Index) + live pricing. Models need the right specs for Regex Writing, then benchmark performance refines the order. Full methodology →
| # | Model | Score | In / 1M | Out / 1M | Context | |
|---|---|---|---|---|---|---|
| 1 | OpenAI: GPT-5openai/gpt-5 | 139 | $1.25 | $10.00 | 400,000 | Details → |
| 2 | Anthropic: Claude Sonnet 4.6anthropic/claude-sonnet-4.6 | 139 | $3.00 | $15.00 | 1,000,000 | Details → |
| 3 | OpenAI: o3openai/o3 | 136 | $2.00 | $8.00 | 200,000 | Details → |
| 4 | Anthropic: Claude Opus 4.7anthropic/claude-opus-4.7 | 133 | $5.00 | $25.00 | 1,000,000 | Details → |
| 5 | Anthropic: Claude Opus 4.8anthropic/claude-opus-4.8 | 132 | $5.00 | $25.00 | 1,000,000 | Details → |
| 6 | OpenAI: o4 Mini Highopenai/o4-mini-high | 124 | $1.10 | $4.40 | 200,000 | Details → |
| 7 | Google: Gemini 2.5 Progoogle/gemini-2.5-pro | 124 | $1.25 | $10.00 | 1,048,576 | Details → |
| 8 | Google: Gemini 2.5 Flashgoogle/gemini-2.5-flash | 123 | $0.30 | $2.50 | 1,048,576 | Details → |
| 9 | OpenAI: o3 Mini Highopenai/o3-mini-high | 123 | $1.10 | $4.40 | 200,000 | Details → |
| 10 | OpenAI: o3 Miniopenai/o3-mini | 123 | $1.10 | $4.40 | 200,000 | Details → |
| 11 | OpenAI: GPT-4.1openai/gpt-4.1 | 122 | $2.00 | $8.00 | 1,047,576 | Details → |
| 12 | DeepSeek: DeepSeek V3deepseek/deepseek-chat | 120 | $0.20 | $0.80 | 131,072 | Details → |
| 13 | NVIDIA: Nemotron 3 Nano Omni (free)nvidia/nemotron-3-nano-omni-30b-a3b-reasoning:free | 120 | Free | Free | 256,000 | Details → |
| 14 | Google: Gemma 4 26B A4B (free)google/gemma-4-26b-a4b-it:free | 120 | Free | Free | 262,144 | Details → |
| 15 | Google: Gemma 4 31B (free)google/gemma-4-31b-it:free | 120 | Free | Free | 262,144 | Details → |
How we ranked these
For Regex Writing, we weight models on reasoning quality, low cost. Scores combine each model's public specs with independent benchmark results (Aider Polyglot coding scores, Artificial Analysis intelligence/coding/agentic indices) and live pricing. See full methodology →
Related tasks
Code
Best for SQL Generation
Writing correct, performant SQL from natural-language prompts.
Code
Best for Code Review
Spotting bugs, security issues, and style problems in pull requests.
Code
Best for Code Completion
Inline IDE-style autocomplete that has to feel instant.
Code
Best for Code Refactoring
Safely restructuring an existing codebase across many files.
Code
Best for Bug Fixing
Diagnosing root cause and producing a working patch.
Code
Best for Unit Test Generation
Generating thorough test suites for existing functions.