PHPackages                             rudashi/fluent-regex - 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. rudashi/fluent-regex

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

rudashi/fluent-regex
====================

Elegant way for PHP regex

2.0.0(1y ago)265[1 issues](https://github.com/rudashi/fluent-regex/issues)MITPHPPHP &gt;=8.2CI passing

Since Jun 8Pushed 1y ago2 watchersCompare

[ Source](https://github.com/rudashi/fluent-regex)[ Packagist](https://packagist.org/packages/rudashi/fluent-regex)[ RSS](/packages/rudashi-fluent-regex/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (3)Dependencies (5)Versions (6)Used By (0)

Fluent Regex
============

[](#fluent-regex)

[![Codacy Badge](https://camo.githubusercontent.com/d1377feb52930c1e501e93b3b297def1fbed771091bf89d6d44132be2d0fcea2/68747470733a2f2f6170702e636f646163792e636f6d2f70726f6a6563742f62616467652f47726164652f6635346536656530623361363438373662343636636334366239336661633333)](https://app.codacy.com/gh/rudashi/fluent-regex/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade)[![codecov](https://camo.githubusercontent.com/6cd1ed20e195b4448d0e2d0ad902b8b4309b21917ca0e9c0a5313a7ddc6ee3fa/68747470733a2f2f636f6465636f762e696f2f67682f727564617368692f666c75656e742d72656765782f67726170682f62616467652e7376673f746f6b656e3d30443347514248563159)](https://codecov.io/gh/rudashi/fluent-regex)[![GitHub Actions Workflow Status](https://camo.githubusercontent.com/fc4dba723855d2bb1f9ef565da7777e345c96aea1944735d1bccde2e29a3acfd/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f727564617368692f666c75656e742d72656765782f74657374732e796d6c)](https://camo.githubusercontent.com/fc4dba723855d2bb1f9ef565da7777e345c96aea1944735d1bccde2e29a3acfd/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f727564617368692f666c75656e742d72656765782f74657374732e796d6c)[![GitHub last commit](https://camo.githubusercontent.com/41c758cef2fc18d670d2abdb8a0325bd462bfb6cc635103c0f6eaae95696eb26/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6173742d636f6d6d69742f727564617368692f666c75656e742d7265676578)](https://camo.githubusercontent.com/41c758cef2fc18d670d2abdb8a0325bd462bfb6cc635103c0f6eaae95696eb26/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6173742d636f6d6d69742f727564617368692f666c75656e742d7265676578)
[![GitHub repo size](https://camo.githubusercontent.com/4f04ba00a16d15f9c6c2a15a4f488a0bd7779fcc3372113ee9f3a654522d084d/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f7265706f2d73697a652f727564617368692f666c75656e742d7265676578)](https://camo.githubusercontent.com/4f04ba00a16d15f9c6c2a15a4f488a0bd7779fcc3372113ee9f3a654522d084d/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f7265706f2d73697a652f727564617368692f666c75656e742d7265676578)[![Total Downloads](https://camo.githubusercontent.com/ced17d7c79cc01b69cec1a0e6a6a2a026d29d41c3d838b7eac95957e30d264f0/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f727564617368692f666c75656e742d7265676578)](https://packagist.org/packages/rudashi/fluent-regex)[![GitHub License](https://camo.githubusercontent.com/b37e8235c93aa08b9c1089d4fec986ab6d77196b2a84dba81a0d7eb28859817d/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f727564617368692f666c75656e742d7265676578)](https://camo.githubusercontent.com/b37e8235c93aa08b9c1089d4fec986ab6d77196b2a84dba81a0d7eb28859817d/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f727564617368692f666c75656e742d7265676578)

---

This package provides a simple way to create regular expression in a fluent way.

**Fluent Regex** is a library in PHP that simplifies the creation and management of regular expressions through the use of fluent syntax. Traditional regular expressions can be difficult to read and understand, especially when they become complex. **Fluent Regex** solves this problem by allowing you to build regular expressions using a readable and intuitive object-oriented interface.

> If you thought that finding a `needle` in a `haystack` was impossible, this repository is for you.

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

[](#installation)

Install the [package](https://packagist.org/packages/rudashi/fluent-regex) via [Composer](https://getcomposer.org/)

```
composer require rudashi/fluent-regex
```

Version Guidance
----------------

[](#version-guidance)

VersionBranchPHP VersionComposer Installv2.x[master](https://github.com/rudashi/fluent-regex)^8.2`composer require rudashi/fluent-regex`v1.x[1.x](https://github.com/rudashi/fluent-regex/tree/1.x)^8.1`composer require rudashi/fluent-regex:^1.0`Usage
-----

[](#usage)

```
$regex = Rudashi\Regex::build()
    ->startOfLine()
    ->capture(fn (FluentBuilder $fluent) => $fluent->find('http')->or->find('https'))
    ->then('://')
    ->ignoreCase();

$regex->dump();
// /^(http|https)\:\/\//i

$match = Regex::for('https://100commitow.pl/')->find('100commitow')->check();
// True
```

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

[](#documentation)

The [Fluent Regex documentation](https://rudashi.github.io/fluent-regex/) is extensive and complete, making getting started with regular expression syntax a breeze.

Changelog
---------

[](#changelog)

Detailed changes for each release are documented in the [CHANGELOG.md](https://github.com/rudashi/fluent-regex/blob/master/CHANGELOG.md).

Credits
-------

[](#credits)

- [Rudashi](https://github.com/rudashi)
- [Contributors](../../contributors)

License
-------

[](#license)

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

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance38

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity56

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 ~37 days

Total

5

Last Release

554d ago

Major Versions

v1.1.0 → 2.0.02024-11-03

PHP version history (2 changes)v1.0.0PHP &gt;=8.1

2.0.0PHP &gt;=8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/a2f436f983f0865fa6c1a1cabbf9909143ee48d1cf90ad66731657d85df77de5?d=identicon)[rudashi](/maintainers/rudashi)

---

Top Contributors

[![rudashi](https://avatars.githubusercontent.com/u/5038647?v=4)](https://github.com/rudashi "rudashi (340 commits)")

---

Tags

fluentgeneratorhelperphpregexregular-expressionphpregexpreg

###  Code Quality

TestsPest

Static AnalysisPHPStan, Rector

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/rudashi-fluent-regex/health.svg)

```
[![Health](https://phpackages.com/badges/rudashi-fluent-regex/health.svg)](https://phpackages.com/packages/rudashi-fluent-regex)
```

###  Alternatives

[composer/pcre

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

693313.8M34](/packages/composer-pcre)[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)[selvinortiz/flux

Fluent regular expressions in PHP.

3372.0k1](/packages/selvinortiz-flux)

PHPackages © 2026

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