macOS
brew install grexlocal Homebrew formula metadata
sudo port install grexMacPorts ports tree · textproc/grex/Portfile · source: api.github.com
brew
Command-line tool for generating regular expressions. Version 1.4.6 via Homebrew; verified 2026-06-15.
install
brew install grexlocal Homebrew formula metadata
sudo port install grexMacPorts ports tree · textproc/grex/Portfile · source: api.github.com
nix profile install nixpkgs#grexnixpkgs package indexes · pkgs/by-name/gr/grex/package.nix · source: api.github.com
sudo pacman -S grexArch Linux sync databases · grex · source: geo.mirror.pkgbuild.com
sudo zypper install grexopenSUSE Tumbleweed package metadata · grex · source: download.opensuse.org
scoop install main/grexScoop official bucket manifest trees · bucket/grex.json · source: api.github.com
overview
Command-line tool for generating regular expressions
history
grex is a Rust command-line tool and library that generates regular expressions from user-provided test cases. It belongs to the developer-tooling tradition around regex synthesis: not replacing regex knowledge, but giving users a correct starting expression that can be inspected and refined.
The README states that grex began as a Rust port of Devon Govett's JavaScript regexgen project after regexgen development had apparently ceased. Peter M. Stahl's project kept the regex-generation idea but used Rust's strengths for command-line tooling and expanded the feature set beyond the original port.
Official GitHub releases show public versioned releases starting with v0.1.0 on 2019-10-06, followed by v1.0.0 on 2020-02-02. Later releases added and refined library, CLI, Unicode, packaging, and binding surfaces, while the README presents grex as both a command-line executable and a Rust crate with Python bindings.
grex reached package-manager users through the Rust ecosystem first, with crates.io as the upstream registry path, and through binary/package managers such as Homebrew, MacPorts, Scoop, Chocolatey, Huber, Nix, Arch, and openSUSE as reflected by the README and batch package facts. Its packaging surface is broad because it is a single CLI binary but also a reusable library.
Users pass examples directly on the command line, from a file, or through a Unix pipeline. By default grex generates a specific expression that matches the supplied test cases; flags can generalize output by converting digits, whitespace, word characters, repeated substrings, anchors, groups, escaping, case sensitivity, verbosity, and colorized display.
The README cautions that generated expressions still need human understanding. That caveat is part of the tool's identity: grex is best used to bootstrap or audit a regex, not to remove the need to understand the target language and engine.
grex is package-nerd significant because it packages an algorithmic helper for one of the most common developer annoyances: turning examples into a regular expression. It is also a Rust CLI case study, distributed as source through cargo and as prebuilt binaries or package-manager formulas for users who do not want a Rust toolchain.
Its relationship to regexgen also makes it a small example of ecosystem migration: a JavaScript idea revived as a Rust CLI and library, then exposed through additional language bindings.
security posture
narrow executable package without higher-risk signals.
green risk · low confidence · appliance
Before unattended agent use, check whether the tool reads plaintext credentials, writes remote state, publishes artifacts, or shells out to plugins.
executables
| Command | Kind | Exposure | Note |
|---|---|---|---|
grex | cli | global executable |
freshness
These signals separate page generation age, package-manager activity, and upstream release comparison. Version lag is warned only when an evidence URL and comparable versions are present.
https://github.com/pemistahl/grex
install metadata
| Package key | brew:grex |
|---|---|
| Version | 1.4.6 |
| Package manager | Homebrew |
| Package manager page | https://formulae.brew.sh/formula/grex |
| Homepage | https://pemistahl.github.io/grex-js/ |
| Repository | https://github.com/pemistahl/grex |
| Upstream docs | https://github.com/pemistahl/grex#readme |
| License | Apache-2.0 |
| Source archive | https://github.com/pemistahl/grex/archive/refs/tags/v1.4.6.tar.gz |
| Last updated | 2026-06-15T10:20:17-04:00 |
| Pulse | updated |
| Build dependencies | rust |
| Bottle | available (on arm64_linux, arm64_sequoia, arm64_sonoma, arm64_tahoe, sonoma, x86_64_linux) |
| Homebrew post-install | not defined |
| Service | none declared |
registry facts
| Source Database | Homebrew formula API |
|---|---|
| Tap | homebrew/core |
| Full Name | grex |
| Version Scheme | 0 |
| Revision | 0 |
| Bottle Stable Root URL | https://ghcr.io/v2/homebrew/core |
| Deprecated | no |
| Disabled | no |
| Keg Only | no |
| URL Keys |
|
source database matches
Matches are pulled from external package-manager indexes and kept separate from local Automic Vault package links.
grex
nix profile install nixpkgs#grexgrex 1.4.6-2
A command-line tool for generating regular expressions from user-provided input strings
https://github.com/pemistahl/grex
sudo pacman -S grexgrex 1.4.6-1.2
CLI regex generator
https://github.com/pemistahl/grex
sudo zypper install grexgrex
sudo port install grexmain/grex
scoop install main/grexsource trail
This page is generated by av-web from the private package SQLite artifact built by scripts/generate-pkg-sqlite.py.
View the package source record on GitHub.