awesome-php icon indicating copy to clipboard operation
awesome-php copied to clipboard

Add T-Regx

Open danon opened this issue 5 years ago • 0 comments

Advanced library for Regular Expressions in PHP: https://t-regx.com/

It:

  • Maps warnings, errors, flag errors, C-like errors (preg_last_error()), return type values and other unexpected situations in PHP regular expressions to exceptions.
  • Fixes bugs and incosistencies (fixed in later versions of PHP or not at all)
  • Prevents fatal errors from preg_() methods (for example, by throwing InvalidArgumentException).

Additionally:

  • Provides higher-level API for matching, replacing, spliting, validation.
  • UTF8 support out of the box
  • Removes false positives (in PHP regular expressions, missing group, unmatched group and matched empty string are identical, T-Regx distingushies them)
  • Provides API for chained and multiple patterns.
  • Provides patterns without delimiters, so pattern('\d+'), instead of preg_match('/\d+/');
  • Provides Prepared Patterns, an abstraction for building patterns with user data
  • Functional interface
  • More advanced methods, for example reacting to replacement not being done, optional matches, injecting strings into groups, etc.

About the project:

  • PSR4 followed
  • Semantic versioning
  • PHP 7.1 and 8.1 compatible
  • Composer installable
  • Developed with real TDD in mind (you can see what I mean by "Real TDD" in Contributing.md)

danon avatar Nov 25 '20 17:11 danon