macOS
brew install trelocal Homebrew formula metadata
sudo port install treMacPorts ports tree · devel/tre/Portfile · source: api.github.com
brew
Lightweight, POSIX-compliant regular expression (regex) library. Version 0.9.0 via Homebrew; verified from local package data.
install
brew install trelocal Homebrew formula metadata
sudo port install treMacPorts ports tree · devel/tre/Portfile · source: api.github.com
sudo apk add agrepAlpine Linux edge package indexes · agrep · source: dl-cdn.alpinelinux.org
sudo apt install libtre-devDebian stable package indexes · libtre-dev · source: deb.debian.org
sudo dnf install agrepFedora Rawhide package metadata · agrep · source: dl.fedoraproject.org
nix profile install nixpkgs#trenixpkgs package indexes · pkgs/by-name/tr/tre/package.nix · source: api.github.com
sudo pacman -S treArch Linux sync databases · tre · source: geo.mirror.pkgbuild.com
sudo zypper install agrepopenSUSE Tumbleweed package metadata · agrep · source: download.opensuse.org
overview
Lightweight, POSIX-compliant regular expression (regex) library
history
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.
security posture
library-like 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 |
|---|---|---|---|
agrep | 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/laurikari/tre
install metadata
| Package key | brew:tre |
|---|---|
| Version | 0.9.0 |
| Package manager | Homebrew |
| Package manager page | https://formulae.brew.sh/formula/tre |
| Homepage | https://github.com/laurikari/tre |
| Repository | https://github.com/laurikari/tre |
| Upstream docs | https://github.com/laurikari/tre#readme |
| License | BSD-2-Clause |
| Source archive | https://github.com/laurikari/tre/releases/download/v0.9.0/tre-0.9.0.tar.gz |
| Bottle | available (on arm64_linux, arm64_sequoia, arm64_sonoma, arm64_tahoe, arm64_ventura, sonoma, ventura, x86_64_linux) |
| Homebrew post-install | not defined |
| Service | none declared |
registry facts
| 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 |
|
source database matches
Matches are pulled from external package-manager indexes and kept separate from local Automic Vault package links.
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-commonsource 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.