Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Reverse Regex Laravel Package

ilario-pierbattista/reverse-regex

ReverseRegex generates random text strings that match a given regular expression, making it easy to create test data for web forms, databases, and regex testing. A fork of icomefromthenet/reverse-regex with lexer, parser, and scope-based generation.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Test-data strategy for validation-heavy features: Use regex-driven generation to replace brittle handcrafted fixtures for phone numbers, postcodes, IDs, account numbers, promo codes, and other pattern-constrained fields. This directly improves coverage for signup, KYC, payments, and form-validation flows.
  • Build vs. buy for QA tooling: Justify a small, MIT-licensed dependency over a custom regex-string generator when the need is narrow and test-only. Release 0.8.0 strengthens the quality case: strict_types=1 across all source files, PHPStan level 6 with no baseline, a 90% coverage floor with Codecov reporting, a PHP 8.1/8.5 lowest/highest CI matrix, and Dependabot. However, with 3 stars and 0 dependents, it should still be treated as a tactical utility, not critical infrastructure.
  • Dependency-risk review: 0.8.0 widens runtime dependency ranges (doctrine/lexer now accepts ^3, doctrine/collections accepts ^2 and ^3) while keeping previously supported versions working. This lowers the chance of a Composer conflict when piloting inside an existing Laravel application—a common blocker for "small utility" adoption decisions.
  • Roadmap prioritization: Supports investment in test infrastructure where manual fixture creation is a recurring bottleneck. If teams frequently write regex-compliant test data by hand, this package can shorten QA cycles without expanding product scope.
  • Compliance and audit readiness: Enables reproducible generation of data matching regulatory or domain-specific formats for validation testing. Useful in regulated workflows where QA must demonstrate coverage against strict input rules. The 0.8.0 bug fixes (ArrayCollection::getAt() out-of-range handling, Parser scope/short-parse correctness) reduce the risk of silently wrong generated data in evidence-producing test runs.
  • Localization and Unicode testing: Provides limited Unicode/hex range support for internationalized input testing. It is not a full Unicode regex engine, but it can cover selected non-ASCII formatting cases.
  • Developer productivity and test maintainability: Fits Laravel factories, seeders, PHPUnit/Pest test setup, and CI pipelines. A PM can sponsor an internal wrapper so teams get consistent test-data generation without coupling product code directly to the package.
  • Upgrade-cost management: 0.8.0 is a hardening release, not a feature release. The only breaking surface is for subclasses: native return types were added to Scope, Node::contains(), Parser and the Parser\Quantifier/Parser\Unicode strategies, and Parser/Quantifier properties are now typed. Public interfaces are unchanged, and normal consumer usage (generating strings) is unaffected. If the recommended internal helper is kept as a thin, non-subclassing wrapper, this upgrade is a low-effort dependency bump.
  • Risk management decision: Adopt in test-only tooling, not production runtime. Low community adoption means the PM should require an exit plan: wrap usage behind an internal helper and vendor/fork if the package becomes important. Note that tests are no longer shipped in the package archive from 0.8.0 onward—any fork-and-patch plan should account for pulling tests from the upstream repository.

When to Consider This Package

Adopt when:

  • The team repeatedly needs regex-compliant synthetic strings for tests, seeds, API payloads, or validation edge cases.
  • The regex patterns are simple to moderately complex and supported by the package: literals, character classes, alternation, groups, quantifiers, \d, \w, \s, and selected Unicode/hex ranges.
  • The project is on PHP 8.1+ and can consume a framework-agnostic Composer package inside Laravel test utilities.
  • Deterministic/seeded randomness matters for reproducible CI tests.
  • The team is willing to own integration risk and isolate the package behind an internal test-data helper or factory method.
  • The use case is test/QA tooling, where occasional package quirks are acceptable and do not affect customers.
  • The team wants a dependency that coexists with modern Doctrine versions and enforces strict typing and static analysis—useful signals when the same test tools are audited under the team's own engineering standards.

Look elsewhere when:

  • You need general-purpose fake data such as names, addresses, sentences, or realistic user profiles. Faker or Laravel factories are better.
  • Your requirements include unsupported regex features: lookarounds, backreferences, conditional patterns, \p{...} Unicode properties, or advanced full-regex semantics.
  • You need enterprise support, SLAs, broad community validation, or long-term maintenance guarantees. The package has very low adoption and should not be a strategic dependency without a fork/vendor plan.
  • The data is used in production, not tests. This is a synthetic test-data generator, not a runtime data service.
  • The need is simple enough for Faker providers, Laravel factories, or a few handcrafted fixtures.
  • The team cannot tolerate limited regex support or package-level risk, even in test tooling.
  • The team has subclassed the parser internals as part of a prior integration; 0.8.0 requires signature updates there, so budget a small refactor or migrate to the thin-wrapper approach instead.

How to Pitch It (Stakeholders)

Executive summary: ReverseRegex is a low-cost, MIT-licensed utility for generating test strings that match regex patterns. It can reduce manual QA effort for validation-heavy features such as phone numbers, postcodes, IDs, and compliance-format inputs. The latest release (0.8.0) is a maintenance and hardening release rather than a feature release: strict typing across the codebase, PHPStan level 6 with no baseline, a 90% minimum coverage gate, a broader PHP version matrix, and fixes for edge-case generation bugs. It widens supported Doctrine dependency ranges, which reduces integration friction, and contains only a narrow breaking change affecting code that subclasses its internals. Adoption remains very low—3 stars and 0 dependents—so it should be piloted as a test-only utility, not adopted as critical platform infrastructure. Recommendation: proceed with the small pilot behind an internal helper; if successful, vendor or fork the package to control risk.

For engineering: The package is framework-agnostic PHP and can be used in Laravel factories, seeders, PHPUnit/Pest setup, and CI scripts. It supports common regex constructs and seeded randomness, which helps reproducible tests. Upgrading to 0.8.0 is low risk for normal consumers: PSR-0 was replaced with PSR-4 (same namespaces and class names), tests no longer ship in the archive, and all source files are now strict_types=1. The breaking surface is limited to subclasses—native return types on Scope, Node::contains(), Parser and its Quantifier/Unicode strategies, plus typed Parser/Quantifier properties. Scope::generate() now normalises null to '', and the ContextInterface::generate() docblocks declare $result as string|null in and string out, which should quiet Psalm/static-analysis noise. Fixed: ArrayCollection::getAt() now returns null outside 1..count() as documented, Parser no longer attaches a null scope when constructed without an explicit head, Parser\Short::parse() returns the documented head scope, and Node::detach() no longer trips the PHP 8.5 SplObjectStorage::detach() deprecation. It does not support advanced regex features such as lookarounds, backreferences, or Unicode properties. Integrate it through an internal RegexTestData helper (composition, not subclassing) so the dependency can be swapped or forked without rewriting tests.

For product/QA leadership: Use it where test data is pattern-constrained and currently handcrafted. Do not use it for realistic user-profile data or production data generation. The 0.8.0 fixes are relevant to QA credibility—generated values are now correct in documented edge cases rather than silently wrong—which matters if test output is used as evidence of validation coverage. Measure pilot success by reduced fixture maintenance, fewer flaky validation tests, and faster creation of edge-case inputs. Treat broad rollout as contingent on the pilot proving value and the team accepting low-community-dependency risk.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
coleus/frame
thtg88/journalism
filagora/filagora-ai-forums
rlacerda83/query-parser
socialdept/atp-orm
cboxdk/laravel-assistant-client
socialdept/atp-resolver
socialdept/tenant-domains
tautvydasr/blade-class-names
socialdept/color-scales
maherelgamil/controller
coleus/widgets
coleus/table
coleus/users
coleus/music
coleus/health
coleus/calendar
coleus/notes
coleus/support
coleus/settings