Code · best for

Top picks for Regex Writing (2026)

Crafting regular expressions that actually match what you intend. Ranked from 334 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 DeepSeek: DeepSeek V4 Prodeepseek/deepseek-v4-pro 137 $0.43 $0.87 1,048,576 Details →
3 OpenAI: GPT-5.4openai/gpt-5.4 136 $2.50 $15.00 1,050,000 Details →
4 Z.ai: GLM 5.2z-ai/glm-5.2 136 $1.00 $4.00 1,048,576 Details →
5 DeepSeek: DeepSeek V4 Flashdeepseek/deepseek-v4-flash 136 $0.09 $0.18 1,048,576 Details →
6 MoonshotAI: Kimi K2.6moonshotai/kimi-k2.6 136 $0.66 $3.50 262,144 Details →
7 Anthropic: Claude Opus 4.7anthropic/claude-opus-4.7 135 $5.00 $25.00 1,000,000 Details →
8 MiniMax: MiniMax M3minimax/minimax-m3 134 $0.30 $1.20 1,048,576 Details →
9 Google: Gemini 3.1 Pro Previewgoogle/gemini-3.1-pro-preview 134 $2.00 $12.00 1,048,576 Details →
10 Google: Gemini 3.5 Flashgoogle/gemini-3.5-flash 133 $1.50 $9.00 1,048,576 Details →
11 Z.ai: GLM 5.1z-ai/glm-5.1 133 $0.98 $3.08 202,752 Details →
12 MoonshotAI: Kimi K2.7 Codemoonshotai/kimi-k2.7-code 133 $0.61 $3.07 262,144 Details →
13 Qwen: Qwen3.5 397B A17Bqwen/qwen3.5-397b-a17b 133 $0.39 $2.45 256,000 Details →
14 Xiaomi: MiMo-V2.5-Proxiaomi/mimo-v2.5-pro 132 $0.43 $0.87 1,048,576 Details →
15 OpenAI: o3openai/o3 132 $2.00 $8.00 200,000 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