php-standard-library/regex
Type-safe regex for PHP with typed capture groups and predictable error handling. Build expressions with confidence, get structured match results, and avoid silent failures common in preg_* functions. Part of PHP Standard Library.
|
Package
|
Score
|
Description
|
Stars
|
Likes
|
Forks
|
Downloads
|
Issues
|
Score
|
Opportunity
|
License
|
Last Release
|
|
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| apie/regex-tools | 0.86 | Utility package from the Apie ecosystem that provides internal tools for working with regular expressions in PHP, including helpers for building and validating regex patterns. Maintained in the Apie monorepo; primarily intended for internal use. | 0 | 0 | 0 | 0 | 0 | 0.0 | — | MIT | — | |
| ilario-pierbattista/reverse-regex | 0.86 | Generate example strings from regular expressions in PHP—useful for test data for forms, databases, and regex validation. Includes lexer/parser and random generators, supports literals, groups, classes, ranges, and quantifiers (with some Unicode/PCRE limits). | 2 | 3 | 2 | 4K | 0 | 14.9 | 48.3 | MIT | 4 months ago | |
| spatie/regex | 0.86 | Cleaner, safer wrapper around PHP’s preg_* functions. Provides Regex::match/matchAll/replace with MatchResult objects, easy access to groups, sensible defaults, and callback-based replacements—no by-reference variables or confusing false/null error handling. | 1,122 | 1,134 | 49 | 991K | 0 | 11.6 | 40.7 | MIT | 4 years ago | |
| icomefromthenet/reverse-regex | 0.85 | Generate sample strings from regular expressions for test data and validation. ReverseRegex parses a supported subset of regex syntax (literals, groups, character classes, quantifiers, escapes, some Unicode via \X{####}) and outputs randomized matching text via PHP generators. | 136 | 138 | 37 | 808 | 4 | 3.1 | 17.3 | MIT | — | |
| composer/pcre | 0.85 | Type-safe wrapper around PHP’s preg_* functions. Composer\Pcre\Preg prevents silent PCRE failures, standardizes return types (PREG_UNMATCHED_AS_NULL), and improves static analysis with a PHPStan extension for regex-aware typing. | 707 | 707 | 15 | 12M | 0 | 29.3 | 64.5 | MIT | 1 month ago | |
| s9e/regexp-builder | 0.85 | Generate compact regular expressions that match a given list of strings (ideal for keyword search). Builds optimized patterns like ba[rz]|foo from input terms, with factories for PHP, Java, JavaScript, RE2, plus RawBytes/RawUTF8 output modes. | 34 | 36 | 3 | 76K | 0 | 5.1 | 46.1 | MIT | 3 years ago | |
| niklongstone/regex-reverse | 0.85 | Generate random strings that match a given PCRE-style regex. Supports common character classes (\d, \w, \s), ranges, groups, alternation, and quantifiers (*, +, ?, {n,m}). Simple API: RegRev::generate($pattern). | 103 | 105 | 8 | 4K | 2 | 3.0 | 22.6 | MIT | 11 years ago | |
| apie/regex-value-objects | 0.85 | — | 0 | 0 | 0 | 16 | 0 | 0.0 | 17.0 | MIT | — | |
| apie/dateformat-to-regex | 0.84 | Converts PHP date() format strings into “simple” regular expressions for validating date/time strings. Generates regex that matches the format pattern (not full calendar validation, e.g., may accept 30 February). Includes a static DateFormatToRegex::formatToRegex() helper. | 0 | 0 | 0 | 3 | 0 | 0.0 | 18.3 | MIT | — | |
| coduo/php-matcher | 0.83 | Flexible PHP pattern-matching library for testing and validating complex data structures. Compare arrays, JSON and objects against readable expectations, with rich mismatch descriptions to pinpoint differences. Useful for API response assertions and custom validation rules. | 840 | 847 | 85 | 192K | 4 | 24.2 | 36.9 | MIT | 7 months ago | |
| alexeyshockov/pattern-matcher | 0.83 | Lightweight PHP pattern-matching utility by Alexey Shockov. Helps compare values against defined patterns and execute matching logic, enabling cleaner conditional flows than nested if/switch statements. Suitable for small libraries and framework-agnostic use. | 1 | 1 | 0 | 0 | 0 | 0.0 | — | — | — | |
| thecodingmachine/phpstan-strict-rules | 0.62 | Extra-strict PHPStan ruleset that flags risky or inconsistent PHP patterns beyond the default checks. Helps enforce cleaner, safer code by catching edge cases and enforcing best practices, with easy opt-in configuration for existing PHPStan setups. | 289 | 290 | 27 | 51K | 7 | 32.8 | 38.3 | — | 1 month ago | |
| thecodingmachine/phpstan-safe-rule | 0.62 | PHPStan rule set that flags calls to “unsafe” PHP functions that can return false on failure and suggests using the thecodingmachine/safe equivalents that throw exceptions, helping enforce safer, exception-based error handling in your codebase. | 62 | 62 | 25 | 216K | 3 | 26.2 | 57.7 | — | 1 month ago | |
| phpstan/phpstan-strict-rules | 0.62 | Extra-strict, opinionated PHPStan rules for highly defensive, strongly typed PHP. Enforces boolean conditions, numeric operands, strict calls (e.g., in_array), detects useless casts, prevents loop variable overwrites, and requires matching switch/case types. | 704 | 713 | 62 | 3M | 38 | 46.2 | 74.5 | MIT | 2 weeks ago |
How can I help you explore Laravel packages today?