dev-master
9999999-dev https://github.com/patrickschur/words2regexBuild your regular expressions based on your texts.
MIT
The Requires
- php ^7
- ext-mbstring *
by Patrick Schur
regex builder regexp regex-builder
Wallogit.com
2017 © Pedro Peláez
Build your regular expressions based on your texts.
Build your regular expressions based on your texts. It has never been easier to create regular expressions., (*1)
<?php
require 'vendor/autoload.php';
$regex = new Words2Regex\Words2Regex();
$words = [
'abc', 'abcde', 'abcdef',
'bbc', 'bbcde', 'bbcdef',
'cbc', 'cbcde', 'cbcdef',
];
foreach ($words as $word)
{
$regex->add($word);
}
echo $regex->getRegex();
Output2:, (*2)
([abc]bc(def?)?)
<?php
require 'vendor/autoload.php';
$regex = new Words2Regex\Words2Regex();
$words = [
'foo', 'foobar'
];
foreach ($words as $word)
{
$regex->add($word);
}
echo $regex->getRegex();
Output2:, (*3)
foo(bar)?
Build your regular expressions based on your texts.
MIT
regex builder regexp regex-builder