ilario-pierbattista/reverse-regex
Generate example strings from regular expressions in PHP—useful for test data for forms, databases, and regex validation. Includes lexer/parser and random generators, supports literals, groups, classes, ranges, and quantifiers (with some Unicode/PCRE limits).
This is a fork of https://github.com/icomefromthenet/ReverseRegex (that provides
icomefromthenet/reverse-regex).
Use Regular Expressions to generate text strings can be used in the following situations:
##Example
use ReverseRegex\Lexer;
use ReverseRegex\Random\SimpleRandom;
use ReverseRegex\Parser;
use ReverseRegex\Generator\Scope;
# load composer
require "vendor/autoload.php";
$lexer = new Lexer('[a-z]{10}');
$gen = new SimpleRandom(10007);
$result = '';
$parser = new Parser($lexer,new Scope(),new Scope());
$parser->parse()->getResult()->generate($result,$gen);
echo $result;
Produces
jmceohykoa
aclohnotga
jqegzuklcv
ixdbpbgpkl
kcyrxqqfyw
jcxsjrtrqb
kvaczmawlz
itwrowxfxh
auinmymonl
dujyzuhoag
vaygybwkfm
##Installing
To install use composer
composer require ilario-pierbattista/reverse-regex
\X{####} to specify unicode value use [\X{####}-\X{####}] to specify range.\p not supported, I could not find a port of UCD to php, maybe in the future support be added.+ and * quantifers they apply a possible maxium number of occurances up to PHP_INT_MAX.How can I help you explore Laravel packages today?