- Does hoa/regex work with Laravel?
- There is no Laravel service provider, facade, config file, or contract — hoa/regex is a framework-agnostic PHP library that only needs PSR-4 autoloading. You integrate it yourself by defining an interface in your domain terms, writing a thin adapter around the Hoa classes, and binding that adapter in a service provider. Keep all Hoa\Regex types inside the adapter so the dependency stays swappable. Do not put it in controllers or jobs that serve user traffic.
- How do I install hoa/regex with Composer?
- Run composer require hoa/regex, but be aware it pulls a large abandoned transitive tree including hoa/compiler, hoa/ustring, hoa/math, hoa/stream, hoa/zformat, hoa/consistency, hoa/iterator, and hoa/exception. Composer 2 will flag the package as abandoned at install time. All of those dependencies come from the same defunct project, so the risk compounds rather than staying local.
- Is hoa/regex still maintained?
- No. The last release was 2017-01-13, the GitHub repository is archived, and the dataset shows zero dependents, which strongly suggests nobody is exercising this code against modern PHP. There is no upstream maintainer to patch bugs or compatibility issues. If you adopt it, plan to own a fork with a named maintainer and a review date.
- Can hoa/regex parse modern PCRE2 patterns?
- Probably not reliably. PHP moved to PCRE2 in 7.3, but hoa/regex ships a 2017-era PCRE grammar, so it may mis-parse constructs that are valid today. The dangerous part is that an unmaintained grammar tends to produce silent mis-parses rather than loud failures. Test against a realistic corpus of the exact patterns you care about before trusting the AST.
- What are realistic use cases for hoa/regex in a Laravel app?
- Good fits are generating fixture or fuzz data from regexes in tests and seeders, validating or analysing user-authored patterns such as promo codes or SKU masks, and building a grammar or DSL feature where the AST is the point. It is a poor fit for anything the HTTP hot path depends on, because parsing is LL(k) grammar work and generation can be unbounded. Keep it in tests, database factories, or an Artisan command.
- How do I generate random strings matching a regex with hoa/regex?
- The library includes an isotropic visitor that samples random strings matching a pattern, which you can call from your adapter. Be careful: sampling with *, +, and nested quantifiers can be unbounded and exhaust memory or hang a PHP-FPM worker. Never feed it untrusted patterns in-process, and consider Faker's regexify() for simple, known pattern shapes.
- Is hoa/regex safe to use in production request handling?
- No — treat it as build-time or test tooling only. Catastrophic backtracking and unbounded sampling mean a single hostile or badly written pattern can hang a worker, and there is no caching layer or Laravel-aware ergonomics to soften that. There is also no security-advisory channel, so composer audit gives a false sense of coverage. If it must run at runtime, isolate it behind a queue or a separate process with strict limits.
- What alternatives to hoa/regex should I evaluate?
- For parsing and analysing patterns, look at s9e/regexp, which is actively maintained. For simple string generation, Faker's regexify() is usually enough, and for narrow, known pattern shapes a hand-rolled generator is often safer. Run your real pattern corpus through both your hoa/regex adapter and the alternative, then diff the outputs before deciding.
- Why is hoa/regex marked abandoned and does that affect security audits?
- The whole Hoa project is defunct — the repository is archived and no releases have shipped since 2017 — so Composer 2 flags it as abandoned on install. Because there is no security-advisory channel, composer audit will not warn you about vulnerabilities in this package or its abandoned dependencies. That means your governance process needs an explicit exception and a review date rather than relying on tooling.
- How should I spike or integrate hoa/regex safely?
- Run a timeboxed two-to-three day spike on your target PHP version: install it, sample a realistic pattern corpus, and confirm parse success and generation behaviour. In parallel, implement the same interface with an actively maintained alternative and diff outputs on the corpus. Then decide between adopt-with-fork, tooling-only, or replace, and if you adopt, keep every Hoa type behind your own interface.