PHPackages                             mpociot/human-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. mpociot/human-regex

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

mpociot/human-regex
===================

Regular expressions for human beings, not machines

1131026[1 issues](https://github.com/mpociot/human-regex/issues)1PHP

Since Aug 30Pushed 9y ago3 watchersCompare

[ Source](https://github.com/mpociot/human-regex)[ Packagist](https://packagist.org/packages/mpociot/human-regex)[ RSS](/packages/mpociot-human-regex/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependenciesVersions (1)Used By (1)

HumanRegex
==========

[](#humanregex)

[![Latest Version on Packagist](https://camo.githubusercontent.com/3e1124aa2bc4ae82007f3472796431cece7fc919e60023db247ba62fcd0a5d42/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6d706f63696f742f68756d616e2d72656765782e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/mpociot/human-regex)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Build Status](https://camo.githubusercontent.com/d1e704db067aa67de0275e0586efc39c1f9b066c212bd3ae4a50dfd4c86dfdc0/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f6d706f63696f742f68756d616e2d72656765782f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/mpociot/human-regex)[![SensioLabsInsight](https://camo.githubusercontent.com/1c11f00c756b9472fd566ec662a879f94d1785d2748f3f4e48b18c12cfbb0df5/68747470733a2f2f696d672e736869656c64732e696f2f73656e73696f6c6162732f692f62643766316165652d643733352d346565342d616635612d6234306239303562356162382e7376673f7374796c653d666c61742d737175617265)](https://insight.sensiolabs.com/projects/bd7f1aee-d735-4ee4-af5a-b40b905b5ab8)[![Quality Score](https://camo.githubusercontent.com/dcfecaa71d12c176d8ba586faf871061ff0e314a6241caacaa5fd287ef6f3022/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f6d706f63696f742f68756d616e2d72656765782e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/mpociot/human-regex)[![Total Downloads](https://camo.githubusercontent.com/7d28361cc141162473e3292af5a59fa3a795107f38852fde5ca578bfab49eacd/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6d706f63696f742f68756d616e2d72656765782e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/mpociot/human-regex)

Regular expressions for human beings, not machines
--------------------------------------------------

[](#regular-expressions-for-human-beings-not-machines)

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

[](#installation)

You can install the package via composer:

```
composer require mpociot/human-regex
```

Usage
-----

[](#usage)

```
$regex = HumanRegex::create()
    ->alphanumerics()
    ->then('-')
    ->digits()->exactly(4)
    ->then('-')
    ->digits()->exactly(2)
    ->then('-')
    ->digits()->exactly(2)
    ->then('.')
    ->thenEither('mov')->or('mp4');

$regex->matches('foobar-2016-08-29.mp4');
```

Changelog
---------

[](#changelog)

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

Testing
-------

[](#testing)

```
$ composer test
```

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

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Security
--------

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Marcel Pociot](https://github.com/mpociot)
- [All Contributors](../../contributors)

License
-------

[](#license)

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

###  Health Score

27

—

LowBetter than 47% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity25

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity41

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.

### Community

Maintainers

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

---

Top Contributors

[![mpociot](https://avatars.githubusercontent.com/u/804684?v=4)](https://github.com/mpociot "mpociot (11 commits)")

### Embed Badge

![Health badge](/badges/mpociot-human-regex/health.svg)

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

###  Alternatives

[cloudstudio/resource-generator

Resource Generator for Laravel Nova

106138.3k1](/packages/cloudstudio-resource-generator)[inpsyde/disable-comments

Entirely ditches comments as a WordPress feature.

1722.6k1](/packages/inpsyde-disable-comments)

PHPackages © 2026

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