Parsica
The easiest way to build robust parsers in PHP.
composer require parsica-php/parsica
Documentation & API: parsica-php.github.io
$parser = between(char('{'), char('}'), atLeastOne(alphaChar()));
$result = $parser->tryString("{Hello}");
echo $result->output(); // Hello
Development
After running composer install
, run these to validate if everything is in working order:
composer run phpunit
composer run psalm
composer run uptodocs
# or all of them:
composer run test