# grex Regular Expression Generator from Test Cases

> grex is a command-line tool and library that automatically generates regular expressions from user-provided test cases. Written in Rust with Python bindings, it produces the most specific regex that matches the given input, supporting Unicode 16.0, character class detection, quantifier notation, and case-insensitive matching.

- Skill: `agentskillexchange/grex-regular-expression-generator-from-test-cases` (Agent Skill)
- Install (CLI): `npx skillmds@latest add agentskillexchange/grex-regular-expression-generator-from-test-cases`
- Raw SKILL.md: https://api.skillmd.com/api/skills/agentskillexchange/grex-regular-expression-generator-from-test-cases/raw
- Safety review: pending (external: skill-scanner PASS, skillspector PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: agentskillexchange (https://skillmd.com/u/agentskillexchange)
- Updated: 2026-09-08
- Page: https://skillmd.com/skills/agentskillexchange/grex-regular-expression-generator-from-test-cases

---


# grex Regular Expression Generator from Test Cases

grex is a command-line tool and library that automatically generates regular expressions from user-provided test cases. Written in Rust with Python bindings, it produces the most specific regex that matches the given input, supporting Unicode 16.0, character class detection, quantifier notation, and case-insensitive matching.

## Installation

Use the upstream install or setup path that matches your environment:
- git clone https://github.com/pemistahl/grex.git
- cargo build
- cargo test
- cargo bench

Requirements and caveats from upstream:
- [![python build status](https://github.com/pemistahl/grex/actions/workflows/python-build.yml/badge.svg)](https://github.com/pemistahl/grex/actions/workflows/python-build.yml)
- ![supported Python versions](https://img.shields.io/badge/Python-%3E%3D%203.12-blue?logo=Python&logoColor=yellow)
- Specifies the minimum length a repeated substring must have in order to be converted if

Basic usage or getting-started notes:
- Input:
- [INPUT]... One or more test cases separated by blank space
- -f, --file <FILE> Reads test cases on separate lines from a file

- Source: https://github.com/pemistahl/grex
- Extracted from upstream docs: https://raw.githubusercontent.com/pemistahl/grex/HEAD/README.md

## Source

- [Agent Skill Exchange](https://agentskillexchange.com/skills/grex-regex-generator-from-test-cases/)

