grex
CLIGenerate regular expressions from test cases.
Auto-generate regex patterns from example strings
Recipes
Curated from documentation and usage. Percentages are estimates, not measurements.
Generate regex from examples
grex foo1 foo2 foo3Generate digit-aware regex
grex --digits foo1 foo2Generate a regex from a list on stdin
sort -u strings.txt | grex -Common failures (1)
- error: the following required arguments were not provided: <INPUT>...grex does not read stdin implicitly; pass a literal - as the input argument
Install
Homebrew
brew install grexCargo
cargo install grexAgent notes
- When to use
- Creating regex patterns from input examples
- Quick examples
grex foo bar bazecho -e 'test1\ntest2' | grex -
Use from an agent
curl -s https://clihub.com/api/tools/grex | jq '.agentHints.provenRecipes[] | {task, command, verified}'Or call get_tool with slug grex on the MCP server at https://clihub.com/mcp.