mpociot/human-regex

Regular expressions for human beings, not machines

Maintainers

Package info

github.com/mpociot/human-regex

pkg:composer/mpociot/human-regex

Statistics

Installs: 102

Dependents: 1

Suggesters: 0

Stars: 114

Open Issues: 1

dev-master 2016-08-30 09:28 UTC

This package is auto-updated.

Last update: 2026-03-08 04:13:48 UTC


README

Latest Version on Packagist Software License Build Status SensioLabsInsight Quality Score Total Downloads

Regular expressions for human beings, not machines

Installation

You can install the package via composer:

composer require mpociot/human-regex

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

Please see CHANGELOG for more information what has changed recently.

Testing

$ composer test

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email m.pociot@gmail.com instead of using the issue tracker.

Credits

License

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