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

        $position   = 0;
        $subjectLen = \mb_strlen($subject);
        $matches    = array();

        \mb_ereg_search_init($subject, $pattern, $option);
        while ($position !== false && $position < $subjectLen) {
            \mb_ereg_search_setpos($position);

            $result = \mb_ereg_search_regs();
            if ($result === false) {
                break;
            }

            foreach ($result as $key => $part) {
                $matches[$key][] = $part;
            }

            $position = \mb_ereg_search_getpos();
        }

        static::tearDown();

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

        $position   = 0;
        $subjectLen = \mb_strlen($subject);
        $matches    = array();

        \mb_ereg_search_init($subject, $pattern, $option);
        while ($position !== false && $position < $subjectLen) {
            \mb_ereg_search_setpos($position);

            $result = \mb_ereg_search_regs();
            if ($result === false) {
                break;
            }

            foreach ($result as $key => $part) {
                $matches[$key][] = $part;
            }

            $position = \mb_ereg_search_getpos();
        }

        static::tearDown();

        return $matches;
    }
Global regular expression match and return all matches.

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