Automic VaultAutomic Vault

brew

Install tre with Homebrew, apk, apt, dnf, MacPorts, Nix, pacman, zypper

Lightweight, POSIX-compliant regular expression (regex) library. Version 0.9.0 via Homebrew; verified from local package data.

install

Additional install commands

macOS

Homebrewverified · 100%
brew install tre

local Homebrew formula metadata

MacPortsverified · 94%
sudo port install tre

MacPorts ports tree · devel/tre/Portfile · source: api.github.com

Linux

Alpine Linux apkverified · 92%
sudo apk add agrep

Alpine Linux edge package indexes · agrep · source: dl-cdn.alpinelinux.org

Debian aptverified · 92%
sudo apt install libtre-dev

Debian stable package indexes · libtre-dev · source: deb.debian.org

Fedora dnfverified · 92%
sudo dnf install agrep

Fedora Rawhide package metadata · agrep · source: dl.fedoraproject.org

Nixverified · 92%
nix profile install nixpkgs#tre

nixpkgs package indexes · pkgs/by-name/tr/tre/package.nix · source: api.github.com

Arch Linux pacmanverified · 92%
sudo pacman -S tre

Arch Linux sync databases · tre · source: geo.mirror.pkgbuild.com

openSUSE zypperverified · 92%
sudo zypper install agrep

openSUSE Tumbleweed package metadata · agrep · source: download.opensuse.org

overview

Package summary

Lightweight, POSIX-compliant regular expression (regex) library

Commands and aliases

  • agrep

history

Project history and usage

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.

Project history

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.

Adoption history

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.

How it is used

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.

Why package nerds care

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.

Timeline

  • 0.5.x: NEWS records pkg-config support, system ABI work, minimal repetition operators, and best-match `agrep` mode.
  • 0.7.6: NEWS records license change from LGPL to BSD-style and removal of gnulib due to potential license conflicts.
  • 0.8.0: NEWS records `tre_` prefixes for exported libtre functions and an ABI change.
  • 0.9.0: NEWS records raw byte-vector API variants and updated Visual Studio project files.

Related projects

  • Related to POSIX regex implementations such as Rx, Regex++, and AT&T ast regex, which the README mentions in its discussion of subpattern correctness.
  • Related to earlier agrep implementations by Sun Wu and Udi Manber, which the README contrasts with TRE's included `agrep`.
  • Related to grep-like command-line search tools, but distinguished by edit-distance matching.

Sources

  • Batch input fields: source_facts.description, source_facts.executables, source_facts.package-manager
  • Official NEWS file: https://github.com/laurikari/tre/blob/master/NEWS
  • Official README: https://github.com/laurikari/tre#readme

security posture

Risk level: green

library-like package without higher-risk signals.

Risk classifier

green risk · low confidence · appliance

Why

  • library-like package without higher-risk signals

Signals

  • metadata:library-like

Install behavior

  • No Homebrew post-install hook is recorded in formula metadata.
  • Homebrew bottle metadata is available for 8 platform targets.

Recommended review

Before unattended agent use, check whether the tool reads plaintext credentials, writes remote state, publishes artifacts, or shells out to plugins.

executables

Installed executables

CommandKindExposureNote
agrepcliglobal executable

freshness

Version and 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.

page generated2026-07-08
manager version0.9.0
manager updated
local dataok
upstreamnot checked
latest detectednot detected

https://github.com/laurikari/tre

  • infoNo package-manager update timestamp was available.low confidence
  • infoNo cached GitHub release or tag data was available.https://github.com/laurikari/trenone confidence

install metadata

Package metadata

Package keybrew:tre
Version0.9.0
Package managerHomebrew
Package manager pagehttps://formulae.brew.sh/formula/tre
Homepagehttps://github.com/laurikari/tre
Repositoryhttps://github.com/laurikari/tre
Upstream docshttps://github.com/laurikari/tre#readme
LicenseBSD-2-Clause
Source archivehttps://github.com/laurikari/tre/releases/download/v0.9.0/tre-0.9.0.tar.gz
Bottleavailable (on arm64_linux, arm64_sequoia, arm64_sonoma, arm64_tahoe, arm64_ventura, sonoma, ventura, x86_64_linux)
Homebrew post-installnot defined
Servicenone declared

registry facts

Source database details

Source DatabaseHomebrew formula API
Taphomebrew/core
Full Nametre
Version Scheme0
Revision0
Bottle Stable Root URLhttps://ghcr.io/v2/homebrew/core
Deprecatedno
Disabledno
Keg Onlyno
URL Keys
  • stable

source database matches

Other package-manager records

Matches are pulled from external package-manager indexes and kept separate from local Automic Vault package links.

Debian apt95%

libtre-dev 0.9.0-1

development package for the libtre5 regexp matching library

https://laurikari.net/tre/

sudo apt install libtre-dev
  • Section: libdevel
  • Architecture: amd64
  • Source Package: tre
  • 1 dependencies
  • normalized package name match
  • Matched by: Tre
Debian stable package indexes · deb.debian.org · Debian stable package indexes: libtre-dev from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz
Debian apt95%

libtre5 0.9.0-1

regexp matching library with approximate matching

https://laurikari.net/tre/

sudo apt install libtre5
  • Section: libs
  • Architecture: amd64
  • Source Package: tre
  • 1 dependencies
  • 1 optional deps
  • normalized package name match
  • Matched by: Tre
Debian stable package indexes · deb.debian.org · Debian stable package indexes: libtre5 from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz
Debian apt95%

tre-agrep 0.9.0-1

approximate grep utility based on the tre library

https://laurikari.net/tre/

sudo apt install tre-agrep
  • Section: text
  • Architecture: amd64
  • Source Package: tre
  • 2 dependencies
  • normalized package name match
  • Matched by: Tre
Debian stable package indexes · deb.debian.org · Debian stable package indexes: tre-agrep from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz
Nix95%

tre

nix profile install nixpkgs#tre
  • normalized package name match
  • Matched by: Tre
nixpkgs package indexes · api.github.com · nixpkgs package indexes: pkgs/by-name/tr/tre/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1
Ubuntu apt95%

libtre-dev 0.8.0-7

development package for the libtre5 regexp matching library

https://laurikari.net/tre/

sudo apt install libtre-dev
  • Section: universe/libdevel
  • Architecture: amd64
  • Source Package: tre
  • 1 dependencies
  • normalized package name match
  • Matched by: Tre
Ubuntu 24.04 LTS package indexes · archive.ubuntu.com · Ubuntu 24.04 LTS package indexes: libtre-dev from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz
Ubuntu apt95%

libtre5 0.8.0-7

regexp matching library with approximate matching

https://laurikari.net/tre/

sudo apt install libtre5
  • Section: universe/libs
  • Architecture: amd64
  • Source Package: tre
  • 1 dependencies
  • 1 optional deps
  • normalized package name match
  • Matched by: Tre
Ubuntu 24.04 LTS package indexes · archive.ubuntu.com · Ubuntu 24.04 LTS package indexes: libtre5 from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz
Ubuntu apt95%

tre-agrep 0.8.0-7

approximate grep utility based on the tre library

https://laurikari.net/tre/

sudo apt install tre-agrep
  • Section: universe/text
  • Architecture: amd64
  • Source Package: tre
  • 2 dependencies
  • normalized package name match
  • Matched by: Tre
Ubuntu 24.04 LTS package indexes · archive.ubuntu.com · Ubuntu 24.04 LTS package indexes: tre-agrep from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz
apk95%

agrep 0.8.0-r2

approximate grepping

https://laurikari.net/tre

sudo apk add agrep
  • License: BSD-2-Clause
  • Architecture: x86_64
  • Source Package: tre
  • 1 dependencies
  • 1 provides
  • normalized package name match
  • Matched by: Tre
Alpine Linux edge package indexes · dl-cdn.alpinelinux.org · Alpine Linux edge package indexes: agrep from https://dl-cdn.alpinelinux.org/alpine/edge/testing/x86_64/APKINDEX.tar.gz
apk95%

agrep-doc 0.8.0-r2

POSIX compliant regexp matching library (documentation)

https://laurikari.net/tre

sudo apk add agrep-doc
  • License: BSD-2-Clause
  • Architecture: x86_64
  • Source Package: tre
  • normalized package name match
  • Matched by: Tre
Alpine Linux edge package indexes · dl-cdn.alpinelinux.org · Alpine Linux edge package indexes: agrep-doc from https://dl-cdn.alpinelinux.org/alpine/edge/testing/x86_64/APKINDEX.tar.gz
apk95%

tre 0.8.0-r2

POSIX compliant regexp matching library

https://laurikari.net/tre

sudo apk add tre
  • License: BSD-2-Clause
  • Architecture: x86_64
  • Source Package: tre
  • 1 dependencies
  • 1 provides
  • normalized package name match
  • Matched by: Tre
Alpine Linux edge package indexes · dl-cdn.alpinelinux.org · Alpine Linux edge package indexes: tre from https://dl-cdn.alpinelinux.org/alpine/edge/testing/x86_64/APKINDEX.tar.gz
apk95%

tre-dev 0.8.0-r2

POSIX compliant regexp matching library (development files)

https://laurikari.net/tre

sudo apk add tre-dev
  • License: BSD-2-Clause
  • Architecture: x86_64
  • Source Package: tre
  • 1 dependencies
  • 1 provides
  • normalized package name match
  • Matched by: Tre
Alpine Linux edge package indexes · dl-cdn.alpinelinux.org · Alpine Linux edge package indexes: tre-dev from https://dl-cdn.alpinelinux.org/alpine/edge/testing/x86_64/APKINDEX.tar.gz
apk95%

tre-static 0.8.0-r2

POSIX compliant regexp matching library (static library)

https://laurikari.net/tre

sudo apk add tre-static
  • License: BSD-2-Clause
  • Architecture: x86_64
  • Source Package: tre
  • normalized package name match
  • Matched by: Tre
Alpine Linux edge package indexes · dl-cdn.alpinelinux.org · Alpine Linux edge package indexes: tre-static from https://dl-cdn.alpinelinux.org/alpine/edge/testing/x86_64/APKINDEX.tar.gz
dnf95%

agrep 0.9.0-4.fc45

Approximate grep utility

http://laurikari.net/tre/

sudo dnf install agrep
  • License: BSD-2-Clause
  • Category: Unspecified
  • Architecture: x86_64
  • Source Package: tre
  • 3 dependencies
  • 1 provides
  • normalized package name match
  • Matched by: Tre
Fedora Rawhide package metadata · dl.fedoraproject.org · Fedora Rawhide package metadata: agrep from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/e5ca8ce900cd68f5419e1c39ae517343100b306336cbaeb70a3c153121d95094-primary.xml.zst
dnf95%

python3-tre 0.9.0-4.fc45

Python bindings for the tre library

http://laurikari.net/tre/

sudo dnf install python3-tre
  • License: BSD-2-Clause
  • Category: Unspecified
  • Architecture: x86_64
  • Source Package: tre
  • 4 dependencies
  • 5 provides
  • normalized package name match
  • Matched by: Tre
Fedora Rawhide package metadata · dl.fedoraproject.org · Fedora Rawhide package metadata: python3-tre from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/e5ca8ce900cd68f5419e1c39ae517343100b306336cbaeb70a3c153121d95094-primary.xml.zst
dnf95%

tre 0.9.0-4.fc45

POSIX compatible regexp library with approximate matching

http://laurikari.net/tre/

sudo dnf install tre
  • License: BSD-2-Clause
  • Category: Unspecified
  • Architecture: i686
  • Source Package: tre
  • 3 dependencies
  • 2 provides
  • normalized package name match
  • Matched by: Tre
Fedora Rawhide package metadata · dl.fedoraproject.org · Fedora Rawhide package metadata: tre from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/e5ca8ce900cd68f5419e1c39ae517343100b306336cbaeb70a3c153121d95094-primary.xml.zst
dnf95%

tre-common 0.9.0-4.fc45

Cross-platform files for use with the tre package

http://laurikari.net/tre/

sudo dnf install tre-common
  • License: BSD-2-Clause
  • Category: Unspecified
  • Architecture: noarch
  • Source Package: tre
  • 1 provides
  • normalized package name match
  • Matched by: Tre
Fedora Rawhide package metadata · dl.fedoraproject.org · Fedora Rawhide package metadata: tre-common from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/e5ca8ce900cd68f5419e1c39ae517343100b306336cbaeb70a3c153121d95094-primary.xml.zst

source trail

Generated from repository data

This page is generated by av-web from the private package SQLite artifact built by scripts/generate-pkg-sqlite.py.

Used sources

  • Geiger risk classifier
  • Nucleus package database
  • av.db category and tag curation
  • cross-ecosystem install command graph
  • curated package history
  • external package-manager database matches
  • package relationship graph
  • package version freshness
  • package-page enrichment