src/PcreExtension.php
public function grep($values, $pattern, $flags = '')
    {
        if (!isset($values)) {
            return null;
        }
        
        if (is_string($flags)) {
            $flags = $flags === 'invert' ? PREG_GREP_INVERT : 0;
        }
        
        return preg_grep($pattern, $values, $flags);
    }
public function grep($values, $pattern, $flags = '')
    {
        if (!isset($values)) {
            return null;
        }
        
        if (is_string($flags)) {
            $flags = $flags === 'invert' ? PREG_GREP_INVERT : 0;
        }
        
        return preg_grep($pattern, $values, $flags);
    }
public function grep ( $ values , $ pattern , $ flags = '' ) { if ( ! isset ( $ values ) ) { return null ; } if ( is_string ( $ flags ) ) { $ flags = $ flags === 'invert' ? PREG_GREP_INVERT : 0 ; } return preg_grep ( $ pattern , $ values , $ flags ) ; }
Perform a regular expression match and return an array of entries that match the pattern

@param array  $values
@param string $pattern
@param string $flags    Optional 'invert' to return entries that do not match the given pattern.
@return array
Perform a regular expression match and return an array of entries that match the pattern