Every package is a read-only split of the PHPRegex — please open issues and pull requests there.
2.0 is coming — try the dev builds and bring your wishes to the discussions.
regex-toolkit— one entry point to every PHPRegex library: parse, validate, explain, check ReDoS, optimize, generate, transpile and lint.
regex-parser— lexer, immutable AST, printers and validators for PCRE-style patterns.regex-linter— lints the regex patterns of a PHP code base; console, JSON, GitHub, Checkstyle and JUnit reports.regex-redos— finds the patterns that backtrack catastrophically (ReDoS), confirmed against the engine.regex-automata— compares pattern languages through automata: equivalence, intersection, subset.regex-optimizer— rewrites patterns into shorter equivalents, checked by language equivalence.regex-explain— explains, highlights and draws regex ASTs: text, HTML, ASCII trees, Mermaid and railroad diagrams.regex-generator— generates sample strings and test cases a pattern matches or rejects.regex-transpiler— transpiles PCRE patterns to JavaScript and Python, with the losses reported.
regex-cli— theregexcommand: validate, explain, analyze, lint and compare patterns from the terminal.regex-phpstan— PHPStan extension that reports the regex patterns your target PHP refuses.regex-psalm— Psalm plugin that types the matches ofpreg_match()andpreg_match_all(), and reports invalid patterns.regex-rector— Rector rules that rewritepreg_*calls into the string functions the automata prove they match.regex-language-server— a Language Server for the regex patterns of PHP files: diagnostics, hovers and code actions.
regex-symfony— Symfony bundle: the Regex service and the regex:* commands.regex-laravel— Laravel integration: the Regex facade and the regex:* artisan commands.
- Quick start — install and parse your first pattern in two minutes.
- Tutorial — a guided walk through regex syntax, concept by concept.
- PCRE2 conformance — how closely the parser follows the real engine, case by case.