/regsem

The easiest way to build robust and meaningful regular expressions in PHP

Primary LanguagePHP

RegSem — The PHP regular expressions relief

RegSem Tests Status

RegSem Analysis Status

The easiest way to build robust and meaningful regular expressions in PHP.

Requirements

  • PHP >= 8.0

Setup

RegSem can be installed with composer.

composer require bakome/regsem

Contribute

Want to be part of the RegSem project? Perfect! All are welcome! Whether you find a bug, have a great feature request feel free to get in touch.

Make sure to read the Contributing Guide before submitting changes.

Current features

  • Simple begin and end for expression
  • Repetitions
  • Special characters

Basic Usage Example

use function Bakome\RegSem\{
    regex,
    beginsWith,
};

$regex = regex(
    beginsWith('Beginning test subject')
);

// Evaluate
$regex('This is false test subject') // Returns true or false

How to run quality tests

PhpUnit run:

composer run phpunit

Psalm run:

composer run psalm

Combined run:

composer run test

Run in docker

docker run --rm -it -w "/regsem" -v "${PWD}:/regsem" php:8.2 vendor/bin/phpunit
docker run --rm -it -w "/regsem" -v "${PWD}:/regsem" php:8.2 vendor/bin/psalm

License

This content is released under the (http://opensource.org/licenses/MIT) MIT License.

TODO