Code · best for

Top picks for Regex Writing (2026)

Crafting regular expressions that actually match what you intend. Ranked from 340 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 →
#ModelScoreIn / 1MOut / 1MContext
1 Anthropic: Claude Sonnet 4.6anthropic/claude-sonnet-4.6 140 $3.00 $15.00 1,000,000 Details →
2 Z.ai: GLM 5.2z-ai/glm-5.2 137 $0.74 $2.34 1,048,576 Details →
3 DeepSeek: DeepSeek V4 Prodeepseek/deepseek-v4-pro 137 $0.43 $0.87 1,048,576 Details →
4 MoonshotAI: Kimi K2.6moonshotai/kimi-k2.6 136 $0.65 $2.72 262,144 Details →
5 OpenAI: GPT-5.4openai/gpt-5.4 136 $2.50 $15.00 1,050,000 Details →
6 DeepSeek: DeepSeek V4 Flashdeepseek/deepseek-v4-flash 136 $0.09 $0.19 1,048,576 Details →
7 xAI: Grok 4.5x-ai/grok-4.5 135 $2.00 $6.00 500,000 Details →
8 OpenAI: GPT-5.6 Lunaopenai/gpt-5.6-luna 135 $1.00 $6.00 1,050,000 Details →
9 OpenAI: GPT-5openai/gpt-5 135 $1.25 $10.00 400,000 Details →
10 Anthropic: Claude Opus 4.7anthropic/claude-opus-4.7 135 $5.00 $25.00 1,000,000 Details →
11 Anthropic: Claude Sonnet 5anthropic/claude-sonnet-5 135 $2.00 $10.00 1,000,000 Details →
12 MiniMax: MiniMax M3minimax/minimax-m3 134 $0.30 $1.20 1,048,576 Details →
13 OpenAI: GPT-5.6 Terraopenai/gpt-5.6-terra 134 $2.50 $15.00 1,050,000 Details →
14 Google: Gemini 3.1 Pro Previewgoogle/gemini-3.1-pro-preview 134 $2.00 $12.00 1,048,576 Details →
15 Google: Gemini 3.5 Flashgoogle/gemini-3.5-flash 133 $1.50 $9.00 1,048,576 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