macOS
brew install trelocal Homebrew formula metadata
sudo port install treMacPorts ports tree · devel/tre/Portfile · source: api.github.com
brew / rank 3395
Lightweight, POSIX-compliant regular expression (regex) library. Version 0.9.0 via Homebrew; verified from local package data. Also installable with debian: sudo apt install libtre-dev.
install
brew install trelocal Homebrew formula metadata
sudo port install treMacPorts ports tree · devel/tre/Portfile · source: api.github.com
sudo apk add treAlpine Linux edge package indexes · tre · source: dl-cdn.alpinelinux.org
sudo dnf install treFedora Rawhide package metadata · tre · 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 apt install libtre-devDebian stable package indexes · libtre-dev · source: deb.debian.org
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 | executable | indexed executable | Discovered from the local executable index. |
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.
install metadata
| Package key | brew:tre |
|---|---|
| Version | 0.9.0 |
| Package manager | Homebrew |
| Homepage | https://github.com/laurikari/tre |
| Repository | https://github.com/laurikari/tre |
| Bottle | not recorded |
| Service | none declared |
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-6.fc45
Approximate grep utility
sudo dnf install agreppython3-tre 0.9.0-6.fc45
Python bindings for the tre library
sudo dnf install python3-tretre 0.9.0-6.fc45
POSIX compatible regexp library with approximate matching
sudo dnf install tretre-common 0.9.0-6.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.