2.0.0-beta.1
PHP requirements have been bumped to 8.1.
⚠ Change in behaviour: alternations at the root level of the generated expression are not put in a non-capturing group anymore. This change is only relevant if the generated expression is used as part of a bigger regexp. The old behaviour can be restored at runtime via the $builder->standalone
property. See below for an example.
$builder = new s9e\RegexpBuilder\Builder;
var_dump($builder->build(['foo', 'bar', 'baz']));
$builder->standalone = false;
var_dump($builder->build(['foo', 'bar', 'baz']));
string(10) "ba[rz]|foo"
string(14) "(?:ba[rz]|foo)"