The lightweight library provides a standardized way to use regular expressions in php including the most popular prepared templates.
- PHP >= 8.0.0
- Able/Helpers
Here's the simpler way to install the Able/Reglib package via composer:
composer require able/reglib
Now you can use library features anywhere in the code:
use \Able\Reglib;
$Regex = new Regex('/vendor/');
echo $Regex->replace('vendor/reglib', 'able'));
//> able/reglib
Or
use \Able\Reglib;
$Regex = new Regex('/^[A-Za-z]+/');
echo $Regex->take('winter is coming'));
//> winter
This package is released under the MIT license.