hylianshield / validator-pcre
PCRE validation layer
Installs: 92
Dependents: 1
Suggesters: 1
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
pkg:composer/hylianshield/validator-pcre
Requires
- php: ^7.0
- ext-pcre: ^7.0
- lib-pcre: ^8.38
- hylianshield/validator: ^2.0.0
Requires (Dev)
- phpunit/phpunit: ~5.5.3
This package is auto-updated.
Last update: 2025-09-29 02:42:00 UTC
README
This package extends the HylianShield Validator and implements a PCRE expression validator.
Configuration
No additional configuration required
Expression
The package exposed an Expression entity, which tests if the given pattern is a valid PCRE pattern and then proceeds to store that pattern.
$expression = new \HylianShield\Validator\Pcre\Expression('/foo/'); echo $expression->getPattern(); // "/foo/"
Expression Validator
The expression validator extends the expression entity and implements the validator interface.
$validator = new \HylianShield\Validator\Pcre\ExpressionValidator('/foo/'); echo $validator->getPattern(); // "/foo/" echo $validator->getIdentifier(); // "pcre(/foo/)" $validator->validate('foo'); // true $validator->validate('bar'); // false