hoa/regex
Hoa\Regex is a PHP library for working with regular expressions at the grammar level. It parses patterns into an AST, offers visitors and generators, and supports analyzing, manipulating, and compiling regexes for advanced tooling.
Architecture fit
hoa/regex is a standalone, framework-agnostic PHP library: a PCRE grammar parsed through hoa/compiler into an AST, plus visitors (notably an isotropic/"random string matching this pattern" sampler). There is no Laravel service provider, facade, config, or contract — integration is purely PSR-4 autoloading plus our own wiring.Integration feasibility
composer require hoa/regex pulls a sizeable abandoned transitive tree (hoa/compiler, hoa/ustring, hoa/math, hoa/stream, hoa/zformat, hoa/consistency, hoa/iterator, hoa/exception). Every one of those is part of the same defunct project, so risk compounds rather than staying local.setlocale/locale assumptions in hoa/ustring), and note that PHP moved to PCRE2 in 7.3, so a 2017-era PCRE grammar may mis-parse patterns that are valid today.composer audit gives us a false sense of coverage.Technical risk
*, +, nested quantifiers) can hang a PHP-FPM worker or exhaust memory. Never feed it untrusted patterns in-process.Key questions
Stack fit
PatternSamplerInterface / PatternAnalyzerInterface in domain terms, implement it with a thin HoaRegexAdapter, and bind it in a service provider. No Hoa types (Hoa\Regex\Ast\*, visitors) may appear outside that adapter — this is what makes the eventual exit cheap.tests/, database/factories/, or an Artisan command.Migration path
s9e/regexp for parsing/analysis; Faker's regexify() for simple generation; hand-rolled generation for narrow, known pattern shapes) and diff outputs on the corpus.Compatibility
composer.lock, set config.platform.php to the deployed runtime, and run CI on the full supported PHP matrix so drift is caught before deploy.\R, possessive quantifiers, POSIX classes) against our corpus rather than trusting the 2017 grammar.Sequencing Contract → spike → parallel-run comparison → decision → (if adopt) fork + CI matrix + flag → exit criteria and owner recorded. Do not let a spike turn into an implicit production dependency without step 3 being an explicit, written decision.
Maintenance
Support
Scaling
Failure modes
hoa/ustring's locale handling leaking into number/date formatting elsewhere in the app.Ramp-up
TPM recommendation
How can I help you explore Laravel packages today?