Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. Preg.php

function Preg::matchStrictGroups

Variant of `match()` which outputs non-null matches (or throws)

@param-out array<int|string, string> $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

Throws

UnexpectedNullMatchException

2 calls to Preg::matchStrictGroups()
Preg::isMatchStrictGroups in vendor/composer/pcre/src/Preg.php
Variant of `isMatch()` which outputs non-null matches (or throws)
Regex::matchStrictGroups in vendor/composer/pcre/src/Regex.php
Variant of `match()` which returns non-null matches (or throws)

File

vendor/composer/pcre/src/Preg.php, line 52

Class

Preg

Namespace

Composer\Pcre

Code

public static function matchStrictGroups(string $pattern, string $subject, ?array &$matches = null, int $flags = 0, int $offset = 0) : int {
    $result = self::match($pattern, $subject, $matchesInternal, $flags, $offset);
    $matches = self::enforceNonNullMatches($pattern, $matchesInternal, 'match');
    return $result;
}
RSS feed
Powered by Drupal