Directory Compare FCRS-1.0 /llms.txt
← Back to Directory

grex

$ grex Community Low Risk
pemistahl · Files & Search · Apache-2.0 · macos / linux / windows

grex synthesizes guaranteed-matching regular expressions from example strings passed as arguments, stdin, or -f <file>. It is 100% stateless and read-only, supporting character class generalization (-d digits, -w word chars, -s whitespace), repetition detection (-r), and --no-anchors.

FCRS-1.0 Score
88 /100
Good
Medium Confidence
Zero-Friction Install
brew install grex
CLI vs MCP Decision CLI Only

Stateless millisecond regex synthesis on the CLI; an MCP server is completely unnecessary.

Agent-Readiness Checklist

— JSON Output
— Field Filtering
✓ Non-Interactive
— Dry-Run
✓ Read-Only Mode
✓ NO_COLOR Clean
— Self-Describing
— Official SKILL.md

Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.

FCRS-1.0 6-Dimension Breakdown

Agent-Readiness 19 / 25

Deterministic, non-interactive single-line stdout output honoring NO_COLOR, though it has no --json wrapper.

  • Outputs a single clean regex line on stdout; respects NO_COLOR
Trust & Safety 25 / 25

100% stateless read-only computation with zero file writes, network access, or shell execution.

  • Strictly read-only string-to-regex generator
Setup & Portability 15 / 15

Static Rust binary packaged via brew install grex, cargo install grex, and GitHub Releases on macOS, Linux, and Windows.

  • Zero-dependency binary across all three platforms
Utility & Efficiency 11 / 15

Eliminates LLM regex-escaping errors by mechanically deriving valid patterns from concrete positive examples.

  • Supports -d, -w, -s, -r, and --no-anchors flags
Maintenance & Lineage 9 / 10

Well-maintained Rust crate and CLI (pemistahl/grex) under Apache-2.0.

  • Mature pemistahl/grex repository
Docs & Verifiability 9 / 10

Clear README examples and comprehensive --help options.

  • Every flag clearly illustrated with input/output examples

Security, Auth & Guardrails

Auth Modes
No Auth
Credential Storage

None required; stateless local computation.

Side Effects
Read-Only
Cost & Quotas

100% free, offline, and open-source (Apache-2.0).

Copyable Guardrail for CLAUDE.md / AGENTS.md
# grex Agent Rules
- Pass `--no-anchors` when embedding the generated regex inside a larger pattern or `grep`/`rg` search.
- Always omit `-c` (`--colorize`) in agent shells so stdout contains only the raw regex string.

Agent-Ready Command Recipes

Safe Read-Only Queries

Generate a regex with digit and repetition generalization
grex -d -r --no-anchors v1.2.3 v10.0.12 v2.4.5

Synthesizes a compact unanchored regex matching version-like inputs using \d and {min,max} quantifiers.

Synthesize a regex from lines in a file
grex -f examples.txt

Reads one test string per line from examples.txt and outputs a single-line anchored regex.

Strengths for Agents

  • + Zero side effects: produces exact, tested regexes from concrete example strings.
  • + Supports -d, -w, -s, -r, and --no-anchors for clean generalization.

Caveats & Pitfalls

  • ! Only infers from positive examples (cannot take negative counter-examples).
  • ! Outputs raw regex string without a --json envelope.

Tested Agent Hosts

Claude Code Codex CLI Gemini CLI