Skip to content
@php-regex

PHPRegex

Static analysis, linter & logic solver for PHP regular expressions

PHPRegex

PHPRegex

Static analysis, linter & logic solver for PHP regular expressions

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.

Start here

  • regex-toolkit — one entry point to every PHPRegex library: parse, validate, explain, check ReDoS, optimize, generate, transpile and lint.

Libraries

  • 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.

Tooling

  • regex-cli — the regex command: 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 of preg_match() and preg_match_all(), and reports invalid patterns.
  • regex-rector — Rector rules that rewrite preg_* 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.

Integrations

  • regex-symfony — Symfony bundle: the Regex service and the regex:* commands.
  • regex-laravel — Laravel integration: the Regex facade and the regex:* artisan commands.

Documentation

  • 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.

Pinned Loading

  1. php-regex php-regex Public

    Static analysis, linter & logic solver for PHP regular expressions

    PHP 29 3

  2. regex-redos regex-redos Public

    [READ-ONLY] Finds the patterns that backtrack catastrophically (ReDoS) from the AST, and can confirm a finding against the engine. Split of php-regex/php-regex.

    PHP

  3. regex-linter regex-linter Public

    [READ-ONLY] Lints the regex patterns of a PHP code base: extraction from PHP sources, lint rules, ReDoS and validity checks, reports in console, JSON, GitHub, Checkstyle and JUnit formats. Split of…

    PHP

  4. regex-toolkit regex-toolkit Public

    [READ-ONLY] One entry point to every PHPRegex library: parse, validate, explain, check ReDoS, optimize, generate, transpile and lint. Split of php-regex/php-regex.

    PHP

  5. regex-cli regex-cli Public

    [READ-ONLY] The regex command: validate, explain, analyze, lint and compare patterns from the terminal. Split of php-regex/php-regex.

    PHP

  6. regex-phpstan regex-phpstan Public

    [READ-ONLY] PHPStan extension that reports the regex patterns your target PHP refuses, and, opt-in, lint and ReDoS findings. Split of php-regex/php-regex.

    PHP

Repositories

Showing 10 of 18 repositories

People

This organization has no public members. You must be a member to see who’s a part of this organization.

Top languages

Loading…

Most used topics

Loading…