macOS
brew install trelocal Homebrew formula metadata
安装
brew install trelocal Homebrew formula metadata
sudo apk add treAlpine Linux edge package indexes · tre · 来源: dl-cdn.alpinelinux.org
sudo dnf install treFedora Rawhide package metadata · tre · 来源: dl.fedoraproject.org
nix profile install nixpkgs#trenixpkgs package indexes · pkgs/by-name/tr/tre/package.nix · 来源: api.github.com
sudo pacman -S treArch Linux sync databases · tre · 来源: geo.mirror.pkgbuild.com
sudo apt install libtre-devDebian stable package indexes · libtre-dev · 来源: deb.debian.org
sudo zypper install agrepopenSUSE Tumbleweed package metadata · agrep · 来源: download.opensuse.org
概览
Lightweight, POSIX-compliant regular expression (regex) library
历史
TRE is Ville Laurikari's lightweight POSIX regular-expression matching library with approximate, or fuzzy, matching. In Homebrew it also matters because the package provides the `agrep` executable, an approximate grep-style command built on TRE.
The official README presents TRE as a POSIX-compliant regexp matcher focused on robustness, predictable performance, and features uncommon in free POSIX implementations. It advertises approximate matching, strict standard conformance, linear worst-case matching time in the searched text, modest memory use, multibyte and wide-character support, binary data support, thread safety, and portability.
TRE's approximate matching uses edit distance, allowing insertions, deletions, and substitutions with configurable costs. The README notes that TRE's included `agrep` differs from older agrep implementations by allowing full regexps of any length, any number of errors, and non-uniform insertion, deletion, and substitution costs.
The NEWS file records a long release line. Earlier releases added approximate matching syntax, pkg-config support, non-greedy repetition, system ABI support, Unicode and wide-character improvements, Python bindings, command-line `agrep` options, Cygwin and MinGW builds, and license changes. Later releases changed the license to a BSD-style license in 0.7.6, introduced a `tre_`-prefixed ABI in 0.8.0, and added raw byte-vector API variants in 0.9.0.
TRE's adoption history is mostly library-driven: C programs and Unix-like systems package it for POSIX regex compatibility plus fuzzy matching. The batch input records package-manager names such as Homebrew `tre`, Debian and Ubuntu `libtre-dev`, MacPorts `tre`, Nix `tre`, and `agrep` packages in apk, dnf, pacman, and zypper.
The split between library package names and `agrep` executable names explains why package catalogs can look inconsistent. Some ecosystems expose the library as TRE, while others emphasize the user-facing approximate grep command.
Library users compile and link against TRE for POSIX regex APIs with stronger matching guarantees, approximate matching, multibyte support, and thread-safe execution. The README documents the usual autotools build path through `./utils/autogen.sh`, `./configure`, `make`, `make check`, and `make install`.
Command-line users encounter TRE through `agrep`, which searches approximately rather than requiring exact matches. That makes it useful for typo-tolerant text search, OCR cleanup, fuzzy log investigation, and cases where edit-distance matching is more important than plain regular-expression grep.
For package nerds, TRE is a compact example of a C library that survives because it offers a hard-to-replace semantic feature: POSIX-like regular expressions with approximate matching and predictable execution behavior.
The Homebrew formula's significance is partly in the executable it exposes. Installing `tre` gives users `agrep`, a niche but memorable command for fuzzy grep workflows, while also supplying headers and libraries that downstream software can build against.
安全态势
library-like package without higher-risk signals.
绿色 风险 · 低 置信度 · appliance
在无人值守的代理使用前,请检查该工具是否读取明文凭据、写入远程状态、发布制品或调用插件。
可执行文件
| 命令 | 类型 | 暴露范围 | 备注 |
|---|---|---|---|
agrep | cli | 全局可执行文件 |
新鲜度
这些信号区分页生成时间、软件包管理器活动和上游发布比较。只有存在证据 URL 和可比较版本时,才会提示版本落后。
https://github.com/laurikari/tre
安装元数据
| 软件包键 | brew:tre |
|---|---|
| 版本 | 0.9.0 |
| 软件包管理器 | Homebrew |
| 软件包管理器页面 | https://formulae.brew.sh/formula/tre |
| 主页 | https://github.com/laurikari/tre |
| 仓库 | https://github.com/laurikari/tre |
| 上游文档 | https://github.com/laurikari/tre#readme |
| 许可证 | BSD-2-Clause |
| 源码归档 | https://github.com/laurikari/tre/releases/download/v0.9.0/tre-0.9.0.tar.gz |
| Bottle | 可用 (于 arm64_linux, arm64_sequoia, arm64_sonoma, arm64_tahoe, arm64_ventura, sonoma, ventura, x86_64_linux) |
| Homebrew post-install | 未定义 |
| 服务 | 未声明 |
注册表事实
| Source Database | Homebrew formula API |
|---|---|
| Tap | homebrew/core |
| Full Name | tre |
| 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 软件包链接分开显示。
libtre-dev 0.9.0-1
development package for the libtre5 regexp matching library
sudo apt install libtre-devlibtre5 0.9.0-1
regexp matching library with approximate matching
sudo apt install libtre5tre-agrep 0.9.0-1
approximate grep utility based on the tre library
sudo apt install tre-agreptre
nix profile install nixpkgs#trelibtre-dev 0.8.0-7
development package for the libtre5 regexp matching library
sudo apt install libtre-devlibtre5 0.8.0-7
regexp matching library with approximate matching
sudo apt install libtre5tre-agrep 0.8.0-7
approximate grep utility based on the tre library
sudo apt install tre-agrepagrep 0.8.0-r2
approximate grepping
sudo apk add agrepagrep-doc 0.8.0-r2
POSIX compliant regexp matching library (documentation)
sudo apk add agrep-doctre 0.8.0-r2
POSIX compliant regexp matching library
sudo apk add tretre-dev 0.8.0-r2
POSIX compliant regexp matching library (development files)
sudo apk add tre-devtre-static 0.8.0-r2
POSIX compliant regexp matching library (static library)
sudo apk add tre-staticagrep 0.9.0-4.fc45
Approximate grep utility
sudo dnf install agreppython3-tre 0.9.0-4.fc45
Python bindings for the tre library
sudo dnf install python3-tretre 0.9.0-4.fc45
POSIX compatible regexp library with approximate matching
sudo dnf install tretre-common 0.9.0-4.fc45
Cross-platform files for use with the tre package
sudo dnf install tre-common来源线索
此页面由 av-web 从 scripts/generate-pkg-sqlite.py 生成的私有软件包 SQLite 工件提供。
View the package source record on GitHub.