Code · best for
Top picks for Regex Writing (2026)
Crafting regular expressions that actually match what you intend. Ranked from 423 live models on the OpenRouter catalog, weighted for reasoning quality, low cost.
Updated 2026-09-08 · prices checked at this morning's rebuild
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 →
1
Anthropic: Claude Opus 4.7 (batch)
140 score
$2.50 in / $12.50 out per 1M
2
Anthropic: Claude Sonnet 4.6 (batch)
138 score
$1.50 in / $7.50 out per 1M
3
Anthropic: Claude Sonnet 4.6
136 score
$3.00 in / $15.00 out per 1M
Which should you use? Anthropic: Claude Opus 4.7 (batch) tops this ranking on blended score. If cost drives the decision, Z.ai: GLM 5.3 Flash is the cheapest of the leaders at $0.07/M input.
| # | Model | Score | In / 1M | Out / 1M | Context | |
|---|---|---|---|---|---|---|
| 1 | Anthropic: Claude Opus 4.7 (batch)anthropic/claude-opus-4.7:batch | 140 | $2.50 | $12.50 | 1,000,000 | Details → |
| 2 | Anthropic: Claude Sonnet 4.6 (batch)anthropic/claude-sonnet-4.6:batch | 138 | $1.50 | $7.50 | 1,000,000 | Details → |
| 3 | Anthropic: Claude Sonnet 4.6anthropic/claude-sonnet-4.6 | 136 | $3.00 | $15.00 | 1,000,000 | Details → |
| 4 | Meta: Muse Spark 1.3meta/muse-spark-1.3 | 136 | $1.25 | $4.25 | 1,048,576 | Details → |
| 5 | Z.ai: GLM 5.3 Flashz-ai/glm-5.3-flash | 135 | $0.07 | $0.25 | 1,310,720 | Details → |
| 6 | Z.ai: GLM 5.3 Flash (batch)z-ai/glm-5.3-flash:batch | 135 | $0.15 | $0.50 | 1,048,575 | Details → |
| 7 | OpenAI: GPT-5.6 Sol (batch)openai/gpt-5.6-sol:batch | 135 | $1.00 | $5.00 | 1,050,000 | Details → |
| 8 | Anthropic: Claude Opus 4.8 (batch)anthropic/claude-opus-4.8:batch | 135 | $2.50 | $12.50 | 1,000,000 | Details → |
| 9 | DeepSeek: DeepSeek V4 Pro 0423deepseek/deepseek-v4-pro | 135 | $0.96 | $1.91 | 1,048,576 | Details → |
| 10 | SpaceXAI: Grok 4.6x-ai/grok-4.6 | 135 | $2.00 | $6.00 | 500,000 | Details → |
| 11 | Claude Opus 5 (batch)anthropic/claude-opus-5:batch | 134 | $2.50 | $12.50 | 1,000,000 | Details → |
| 12 | Z.ai: GLM 5.2z-ai/glm-5.2 | 134 | $0.97 | $3.04 | 1,048,576 | Details → |
| 13 | Google: Gemini 3.8 Flash (batch)google/gemini-3.8-flash:batch | 134 | $0.38 | $1.88 | 1,048,576 | Details → |
| 14 | DeepSeek: DeepSeek V4 Flash Vision Expdeepseek/deepseek-v4-flash-vision-exp | 134 | $0.22 | $0.66 | 1,048,576 | Details → |
| 15 | OpenAI: GPT-5.6 Solopenai/gpt-5.6-sol | 134 | $2.00 | $10.00 | 1,050,000 | Details → |
From this site
PicksByModel API
These rankings as live JSON: quality scores, pricing, and context for every model.
See plans →
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.