Code · best for

Top picks for Regex Writing (2026)

Crafting regular expressions that actually match what you intend. Ranked from 405 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 Opus 4.7 (batch)anthropic/claude-opus-4.7:batch 143 $2.50 $12.50 1,000,000 Details →
2 Anthropic: Claude Sonnet 4.6 (batch)anthropic/claude-sonnet-4.6:batch 142 $1.50 $7.50 1,000,000 Details →
3 Anthropic: Claude Sonnet 4.6anthropic/claude-sonnet-4.6 140 $3.00 $15.00 1,000,000 Details →
4 Anthropic: Claude Opus 4.8 (batch)anthropic/claude-opus-4.8:batch 138 $2.50 $12.50 1,000,000 Details →
5 OpenAI: GPT-5.4 (batch)openai/gpt-5.4:batch 138 $1.25 $7.50 1,050,000 Details →
6 Z.ai: GLM 5.2 (batch)z-ai/glm-5.2:batch 138 $0.70 $2.20 512,000 Details →
7 DeepSeek: DeepSeek V4 Prodeepseek/deepseek-v4-pro 138 $1.17 $2.34 1,048,576 Details →
8 SpaceXAI: Grok 4.6x-ai/grok-4.6 138 $2.00 $6.00 500,000 Details →
9 Qwen: Qwen3.8 Maxqwen/qwen3.8-max 137 $2.00 $6.00 1,000,000 Details →
10 OpenAI: GPT-5.5 (batch)openai/gpt-5.5:batch 137 $2.50 $15.00 1,050,000 Details →
11 Z.ai: GLM 5.2z-ai/glm-5.2 137 $0.50 $3.15 1,048,576 Details →
12 Meta: Muse Spark 1.2meta/muse-spark-1.2 137 $1.25 $4.25 1,048,576 Details →
13 OpenAI: GPT-5.6 Lunaopenai/gpt-5.6-luna 137 $0.10 $0.60 1,050,000 Details →
14 OpenAI: GPT-5.6 Luna (batch)openai/gpt-5.6-luna:batch 137 $0.10 $0.60 1,050,000 Details →
15 Claude Opus 5 (batch)anthropic/claude-opus-5:batch 136 $2.50 $12.50 1,000,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