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

Breadcrumb

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

function Preg::grep

@template T of string|\Stringable

Parameters

string $pattern:

array<T> $array:

int-mask<PREG_GREP_INVERT> $flags PREG_GREP_INVERT:

Return value

array<T>

3 calls to Preg::grep()
ComposerRepository::getPackageNames in vendor/composer/composer/src/Composer/Repository/ComposerRepository.php
ComposerRepository::search in vendor/composer/composer/src/Composer/Repository/ComposerRepository.php
@inheritDoc
RemoveCommand::execute in vendor/composer/composer/src/Composer/Command/RemoveCommand.php

File

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

Class

Preg

Namespace

Composer\Pcre

Code

public static function grep(string $pattern, array $array, int $flags = 0) : array {
    $result = preg_grep($pattern, $array, $flags);
    if ($result === false) {
        throw PcreException::fromFunction('preg_grep', $pattern);
    }
    return $result;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal