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

Breadcrumb

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

function Regex::replaceCallbackStrictGroups

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

Parameters

string $pattern:

($flags is PREG_OFFSET_CAPTURE ? (callable(array<int|string, array{string, int<0, max>}>): string) : callable(array<int|string, string>): string) $replacement:

string $subject:

int-mask<PREG_UNMATCHED_AS_NULL|PREG_OFFSET_CAPTURE> $flags PREG_OFFSET_CAPTURE is supported, PREG_UNMATCHED_AS_NULL is always set:

File

vendor/composer/pcre/src/Regex.php, line 144

Class

Regex

Namespace

Composer\Pcre

Code

public static function replaceCallbackStrictGroups($pattern, callable $replacement, $subject, int $limit = -1, int $flags = 0) : ReplaceResult {
    $result = Preg::replaceCallbackStrictGroups($pattern, $replacement, $subject, $limit, $count, $flags);
    return new ReplaceResult($count, $result);
}
RSS feed
Powered by Drupal