src/Gobie/Regex/Wrappers/Mb/MbRegex.php
public static function grep($pattern, $subject, $option = '')
    {
        static::setUp($pattern);

        $matches = array();
        foreach ((array) $subject as $key => $subjectPart) {
            \mb_ereg_search_init($subjectPart, $pattern, $option);
            if (\mb_ereg_search()) {
                $matches[$key] = $subjectPart;
            }
        }

        static::tearDown();

        return $matches;
    }
public static function grep($pattern, $subject, $option = '')
    {
        static::setUp($pattern);

        $matches = array();
        foreach ((array) $subject as $key => $subjectPart) {
            \mb_ereg_search_init($subjectPart, $pattern, $option);
            if (\mb_ereg_search()) {
                $matches[$key] = $subjectPart;
            }
        }

        static::tearDown();

        return $matches;
    }
Regular expression grep and return matching items.

@param string          $pattern Pattern
@param string|string[] $subject Subject or array of subjects
@param string          $option  Option
@return string[] Array with items that matches given pattern, empty array otherwise
@throws MbRegexException When compilation error occurs
@link http://php.net/function.mb-ereg-search.php