Code · best for

Top picks for Regex Writing (2026)

Crafting regular expressions that actually match what you intend. Ranked from 352 live models on the OpenRouter catalog, weighted for reasoning quality, low cost.

What this is A capability-matched shortlist, not a benchmark-tested winner. Models are scored by the fit of their declared specs (structured output, reasoning, context, modality, price) against Regex Writing. Pair with benchmark sources like Artificial Analysis or LMSys Arena before you ship. Full methodology →
#ModelScoreIn / 1MOut / 1MContext
1 Google: Gemma 4 26B A4B (free)google/gemma-4-26b-a4b-it:free 120 Free Free 262,144 Details →
2 Google: Gemma 4 31B (free)google/gemma-4-31b-it:free 120 Free Free 262,144 Details →
3 Qwen: Qwen3.5-9Bqwen/qwen3.5-9b 120 $0.10 $0.15 262,144 Details →
4 Google: Gemma 4 26B A4B google/gemma-4-26b-a4b-it 119 $0.06 $0.33 262,144 Details →
5 Google: Gemma 4 31Bgoogle/gemma-4-31b-it 119 $0.13 $0.38 262,144 Details →
6 ByteDance Seed: Seed-2.0-Minibytedance-seed/seed-2.0-mini 119 $0.10 $0.40 262,144 Details →
7 Qwen: Qwen3.5-Flashqwen/qwen3.5-flash-02-23 119 $0.07 $0.26 1,000,000 Details →
8 ByteDance Seed: Seed 1.6 Flashbytedance-seed/seed-1.6-flash 119 $0.07 $0.30 262,144 Details →
9 xAI: Grok 4.1 Fastx-ai/grok-4.1-fast 119 $0.20 $0.50 2,000,000 Details →
10 Google: Gemini 2.5 Flash Lite Preview 09-2025google/gemini-2.5-flash-lite-preview-09-2025 119 $0.10 $0.40 1,048,576 Details →
11 xAI: Grok 4 Fastx-ai/grok-4-fast 119 $0.20 $0.50 2,000,000 Details →
12 OpenAI: GPT-5 Nanoopenai/gpt-5-nano 119 $0.05 $0.40 400,000 Details →
13 Google: Gemini 2.5 Flash Litegoogle/gemini-2.5-flash-lite 119 $0.10 $0.40 1,048,576 Details →
14 NVIDIA: Nemotron 3 Nano 30B A3Bnvidia/nemotron-3-nano-30b-a3b 119 $0.05 $0.20 262,144 Details →
15 Mistral: Mistral Small 4mistralai/mistral-small-2603 119 $0.15 $0.60 262,144 Details →

How we ranked these

For Regex Writing, we weight models on reasoning quality, low cost. Higher means better. Scores combine each model's public metadata (context length, modality support, tool calling, structured output, reasoning capability) with live pricing. See full methodology →

Related tasks