Menu

Tree [67dfb8] master /
 History

HTTPS access


File Date Author Commit
 src 2014-06-04 Romain Ardiet Romain Ardiet [be6b9e] PSR-2 + enhance phpdoc
 tests 2013-08-16 Frank Stelzer Frank Stelzer [58110d] added more tests
 .gitignore 2013-08-16 Frank Stelzer Frank Stelzer [19345b] adding composer.lock to ignore
 Example.php 2013-08-27 Mihai Ionut Vilcu Mihai Ionut Vilcu [e2d984] added examples for limit()
 LICENSE 2013-07-19 jehna jehna [792f36] Initial commit
 README.md 2015-12-25 ZitaArlen ZitaArlen [67dfb8] New Readme
 composer.json 2013-08-16 Mihai Ionut Vilcu Mihai Ionut Vilcu [922570] Update composer.json
 phpunit.xml.dist 2013-08-16 Frank Stelzer Frank Stelzer [fdff10] added Composer and PHPUnit integration

Read Me

PHPVerbalExpressions

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

// some tests

$regex = new VerbalExpressions;

$regex  ->startOfLine()
        ->then("http")
        ->maybe("s")
        ->then("://")
        ->maybe("www.")
        ->anythingBut(" ")
        ->endOfLine();


if($regex->test("http://github.com"))
    echo "valid url";
else
    echo "invalid url";

if (preg_match($regex, 'http://github.com')) {
    echo 'valid url';
} else {
    echo 'invalud url';
}


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



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

Other Implementations

You can see an up to date list of all ports on VerbalExpressions.github.io.
- Javascript
- Ruby
- C#
- Python
- Java
- C++

Building the project and running the tests

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

curl -sS https://getcomposer.org/installer | php
php composer.phar install --dev
ln -s vendor/phpunit/phpunit/phpunit.php phpunit
./phpunit

For details visit: http://quoteshunter.com/sad-quotes/

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.