macOS
brew install grexlocal Homebrew formula metadata
sudo port install grexMacPorts ports tree · textproc/grex/Portfile · 来源: api.github.com
安装
brew install grexlocal Homebrew formula metadata
sudo port install grexMacPorts ports tree · textproc/grex/Portfile · 来源: api.github.com
nix profile install nixpkgs#grexnixpkgs package indexes · pkgs/by-name/gr/grex/package.nix · 来源: api.github.com
sudo pacman -S grexArch Linux sync databases · grex · 来源: geo.mirror.pkgbuild.com
sudo zypper install grexopenSUSE Tumbleweed package metadata · grex · 来源: download.opensuse.org
scoop install main/grexScoop official bucket manifest trees · bucket/grex.json · 来源: api.github.com
概览
Command-line tool for generating regular expressions
历史
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.
安全态势
narrow executable package without higher-risk signals.
绿色 风险 · 低 置信度 · appliance
在无人值守的代理使用前,请检查该工具是否读取明文凭据、写入远程状态、发布制品或调用插件。
可执行文件
| 命令 | 类型 | 暴露范围 | 备注 |
|---|---|---|---|
grex | cli | 全局可执行文件 |
新鲜度
这些信号区分页生成时间、软件包管理器活动和上游发布比较。只有存在证据 URL 和可比较版本时,才会提示版本落后。
https://github.com/pemistahl/grex
安装元数据
| 软件包键 | brew:grex |
|---|---|
| 版本 | 1.4.6 |
| 软件包管理器 | Homebrew |
| 软件包管理器页面 | https://formulae.brew.sh/formula/grex |
| 主页 | https://pemistahl.github.io/grex-js/ |
| 仓库 | https://github.com/pemistahl/grex |
| 上游文档 | https://github.com/pemistahl/grex#readme |
| 许可证 | Apache-2.0 |
| 源码归档 | https://github.com/pemistahl/grex/archive/refs/tags/v1.4.6.tar.gz |
| 最后更新 | 2026-06-15T10:20:17-04:00 |
| Pulse | updated |
| 构建依赖 | rust |
| Bottle | 可用 (于 arm64_linux, arm64_sequoia, arm64_sonoma, arm64_tahoe, sonoma, x86_64_linux) |
| Homebrew post-install | 未定义 |
| 服务 | 未声明 |
注册表事实
| 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 |
|
源数据库匹配
匹配项来自外部软件包管理器索引,并与本地 Automic Vault 软件包链接分开显示。
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/grex来源线索
此页面由 av-web 从 scripts/generate-pkg-sqlite.py 生成的私有软件包 SQLite 工件提供。
View the package source record on GitHub.