PHPackages                             cline/relex - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. cline/relex

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

cline/relex
===========

A powerful, fluent regex library for PHP with Pattern value objects, named captures, and comprehensive PCRE support

2.0.2(2mo ago)00MITPHPPHP ^8.4.0CI passing

Since Mar 4Pushed 2mo agoCompare

[ Source](https://github.com/faustbrian/relex)[ Packagist](https://packagist.org/packages/cline/relex)[ RSS](/packages/cline-relex/feed)WikiDiscussions 2.x Synced 1mo ago

READMEChangelog (1)Dependencies (6)Versions (6)Used By (0)

[![GitHub Workflow Status](https://github.com/faustbrian/relex/actions/workflows/quality-assurance.yaml/badge.svg)](https://github.com/faustbrian/relex/actions)[![Latest Version on Packagist](https://camo.githubusercontent.com/d0a32a3d1dd466ad3102ec88beb11843fdbc1bb0e4e77f1ade1e3ccb7f1b0472/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f636c696e652f72656c65782e737667)](https://packagist.org/packages/cline/relex)[![Software License](https://camo.githubusercontent.com/784362b26e4b3546254f1893e778ba64616e362bd6ac791991d2c9e880a3a64e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d677265656e2e737667)](LICENSE.md)[![Total Downloads](https://camo.githubusercontent.com/9eea424aa5a948a2655503ce6afb2efdebd556071e4e47ac04a0f9fee0009ab3/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f636c696e652f72656c65782e737667)](https://packagist.org/packages/cline/relex)

---

Relex is an elegant library for working with regular expressions in PHP. It provides a clean, fluent API that wraps PHP's preg\_\* functions with immutable value objects and expressive methods.

Requirements
------------

[](#requirements)

> **Requires [PHP 8.4+](https://php.net/releases/)**

Installation
------------

[](#installation)

```
composer require cline/relex
```

Documentation
-------------

[](#documentation)

- **[Getting Started](https://docs.cline.sh/relex/getting-started)** - Installation, configuration, and basic concepts
- **[Basic Usage](https://docs.cline.sh/relex/basic-usage)** - Matching, replacing, splitting, and common operations
- **[Pattern Builder](https://docs.cline.sh/relex/pattern-builder)** - Building patterns with modifiers and fluent API
- **[Value Objects](https://docs.cline.sh/relex/value-objects)** - Working with MatchResult, MatchAllResult, ReplaceResult, and SplitResult

Change log
----------

[](#change-log)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) and [CODE\_OF\_CONDUCT](CODE_OF_CONDUCT.md) for details.

Security
--------

[](#security)

If you discover any security related issues, please use the [GitHub security reporting form](https://github.com/faustbrian/relex/security) rather than the issue queue.

Credits
-------

[](#credits)

- [Brian Faust](https://github.com/faustbrian)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License. Please see [License File](LICENSE.md) for more information.

###  Health Score

39

—

LowBetter than 86% of packages

Maintenance88

Actively maintained with recent releases

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~25 days

Total

5

Last Release

61d ago

Major Versions

1.0.0 → 2.0.02026-03-04

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/22145591?v=4)[Brian Faust](/maintainers/faustbrian)[@faustbrian](https://github.com/faustbrian)

---

Top Contributors

[![faustbrian](https://avatars.githubusercontent.com/u/22145591?v=4)](https://github.com/faustbrian "faustbrian (9 commits)")

---

Tags

phpregexPCREregular expressionpregpatternMatchreplace

### Embed Badge

![Health badge](/badges/cline-relex/health.svg)

```
[![Health](https://phpackages.com/badges/cline-relex/health.svg)](https://phpackages.com/packages/cline-relex)
```

###  Alternatives

[composer/pcre

PCRE wrapping library that offers type-safe preg\_\* replacements.

699313.8M34](/packages/composer-pcre)[rawr/t-regx

PHP regular expression brought up to modern standards.

451157.3k3](/packages/rawr-t-regx)[gherkins/regexpbuilderphp

PHP port of thebinarysearchtree/regexpbuilderjs

1.4k163.0k1](/packages/gherkins-regexpbuilderphp)[regex-guard/regex-guard

A wrapper that allows you to validate regular expressions and handle normally uncatchable PCRE compilation warnings

24509.2k8](/packages/regex-guard-regex-guard)[niklongstone/regex-reverse

Regular Expression reverter, generates a string from a provided regular expression

105150.4k4](/packages/niklongstone-regex-reverse)[selvinortiz/flux

Fluent regular expressions in PHP.

3372.0k1](/packages/selvinortiz-flux)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
