PHP Regular expressions made easy
Latest commit d1d4d96 Jan 18, 2017 @ronfroy ronfroy committed with ionutvmi add digit method (#24)
* add digit method

* composer bootstrap should not be fixed with php-cs-fixer

* add digit unit test

* php-cs-fixer must be a dev-dependency (no need in prod env)

Build Status


VerbalExpressions is a PHP library that helps to construct hard regular expressions.

// some tests

$regex = new VerbalExpressions;

$regex  ->startOfLine()
        ->anythingBut(" ")

    echo "valid url";
    echo "invalid url";

if (preg_match($regex, '')) {
    echo 'valid url';
} else {
    echo 'invalid url';

echo "<pre>". $regex->getRegex() ."</pre>";

echo $regex ->clean(array("modifiers" => "m", "replaceLimit" => 4))
            ->find(' ')
            ->replace("This is a small test and some more text.", "-");

Other Implementations

You can see an up to date list of all ports on

Building the project and running the tests

The project supports Composer so you have to install Composer first before project setup.

curl -sS | php
php composer.phar install --dev
ln -s vendor/phpunit/phpunit/phpunit.php phpunit