1. Go to this page and download the library: Download uwebpro/regex-builder library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
uwebpro / regex-builder example snippets
// some tests
alExpressions\VerbalExpressions;
$regex = new VerbalExpressions();
$regex->startOfLine()
->then("http")
->maybe("s")
->then("://")
->maybe("www.")
->anythingBut(" ")
->endOfLine();
if ($regex->test("http://github.com")) {
echo "valid url". '<br>';
} else {
echo "invalid url". '<br>';
}
if (preg_match($regex, 'http://github.com')) {
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 http://somesite.com and some more text.", "-");
$definition = 'start, then "http", maybe "s", then "://", maybe "www.", anything but " ", end';
$regex = new VerbalExpressionsScenario($definition);
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.