The easiest way to build robust and meaningful regular expressions in PHP.
- PHP >= 8.0
RegSem can be installed with composer.
composer require bakome/regsemWant 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.
- Simple begin and end for expression
- Repetitions
- Special characters
use function Bakome\RegSem\{
regex,
beginsWith,
};
$regex = regex(
beginsWith('Beginning test subject')
);
// Evaluate
$regex('This is false test subject') // Returns true or falsePhpUnit run:
composer run phpunitPsalm run:
composer run psalmCombined run:
composer run testRun 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/psalmThis content is released under the (http://opensource.org/licenses/MIT) MIT License.
- Followed by
- Any char
- Special chars
- Capture groups
- (Characters) classes
- https://couscous.io/templates.html Documentation