# rust-lang/regex

An implementation of regular expressions for Rust. This implementation uses finite automata and guarantees linear time matching on all inputs.

Repository: https://github.com/rust-lang/regex
Canonical: https://ross.abutalabs.com/products/regex
Homepage: https://docs.rs/regex
Language: Rust
License: Apache-2.0
License Family: permissive
Topics: regex, regexp, regular-expressions, regex-engine, regex-syntax, regex-parser, rust, dfa, nfa, automata, automaton
Last push: 2026-08-10T16:19:27+00:00

## Health v2 (maintenance only)
Score: 66/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 97, release rhythm 8, longevity 100
- inputs: {"age_days": 4283, "days_push": 23, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 4012, forks 529 (observed 2026-08-28T04:08:32.346160+00:00)

## What it is
The standard regular expression crate for Rust, built on finite automata (DFAs/NFAs) to guarantee worst-case linear-time matching. It supports a rich regex syntax including Unicode, but omits look-around and backreferences to preserve that guarantee.

## Use cases
- match and extract patterns from text in Rust
- parse log lines or grep-like output with regexes
- validate user input like dates or emails
- search large text corpora without regex denial-of-service risk
- extract named capture groups from strings

## When to choose
- you need guaranteed linear-time matching with no catastrophic backtracking
- you want the de facto standard, battle-tested regex library for Rust
- you need full Unicode support in patterns
- you're processing untrusted input with regexes

## When to avoid
- you need look-around (lookahead/lookbehind) or backreferences
- you want PCRE-compatible semantics
- you need a regex engine for a language other than Rust

## Facets
- artifact type: library
- maturity: stable
- function: parser, search-engine, developer-tools
- domain: programming-languages, parsers, developer-tools
- platform: rust, cross-platform
- tags: regex-engine, finite-automata, linear-time-matching, dfa, nfa, text-search, unicode, algorithms

## Member repositories
- rust-lang/regex (main) score 66

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:08:32.346160+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-29T18:24:01.348296+00:00, confidence not recorded.
  - readme: https://github.com/rust-lang/regex (fetched 2026-08-28T04:08:32.346160+00:00, sha 02d05e0a69e0)
  - homepage: https://docs.rs/regex (fetched 2026-08-29T09:16:59.731257+00:00, sha f86027bda854)
  - site_page: https://docs.rs/ (fetched 2026-08-29T09:16:59.742158+00:00, sha 35213d539031)
  - site_page: https://docs.rs/crate/regex/latest (fetched 2026-08-29T09:16:59.744036+00:00, sha 7244a3a5b7e5)
  - site_page: https://docs.rs/crate/regex/latest/features (fetched 2026-08-29T09:16:59.746984+00:00, sha 2328374438b2)
  - site_page: https://docs.rs/about (fetched 2026-08-29T09:16:59.748882+00:00, sha 29ab7986fbf5)
  - site_page: https://docs.rs/about/badges (fetched 2026-08-29T09:16:59.751340+00:00, sha 6588cac258af)
  - site_page: https://docs.rs/about/builds (fetched 2026-08-29T09:16:59.752825+00:00, sha 811231ca4680)
  - site_page: https://docs.rs/about/metadata (fetched 2026-08-29T09:16:59.754397+00:00, sha 0dcdccb2b2b2)
  - site_page: https://docs.rs/about/redirections (fetched 2026-08-29T09:16:59.756053+00:00, sha 1b1efd93105f)
- Data as of 2026-08-30T08:39:29.467469+00:00.
