function Preg::match
@param-out array<int|string, string|null> $matches
Parameters
non-empty-string $pattern:
array<mixed> $matches Set by method:
int-mask<PREG_UNMATCHED_AS_NULL> $flags PREG_UNMATCHED_AS_NULL is always set, no other flags are supported:
Return value
0|1
7 calls to Preg::match()
- InvalidRegexPatternRule::validatePattern in vendor/
composer/ pcre/ src/ PHPStan/ InvalidRegexPatternRule.php - JsonManipulator::addSubNode in vendor/
composer/ composer/ src/ Composer/ Json/ JsonManipulator.php - JsonManipulator::removeSubNode in vendor/
composer/ composer/ src/ Composer/ Json/ JsonManipulator.php - Preg::isMatch in vendor/
composer/ pcre/ src/ Preg.php - Variant of match() which returns a bool instead of int
- Preg::matchStrictGroups in vendor/
composer/ pcre/ src/ Preg.php - Variant of `match()` which outputs non-null matches (or throws)
File
-
vendor/
composer/ pcre/ src/ Preg.php, line 29
Class
Namespace
Composer\PcreCode
public static function match(string $pattern, string $subject, ?array &$matches = null, int $flags = 0, int $offset = 0) : int {
self::checkOffsetCapture($flags, 'matchWithOffsets');
$result = preg_match($pattern, $subject, $matches, $flags | PREG_UNMATCHED_AS_NULL, $offset);
if ($result === false) {
throw PcreException::fromFunction('preg_match', $pattern);
}
return $result;
}