src/Processors/DocumentsProcessor.php
protected function getGalleryMatches($text)
    {
        preg_match_all('~\[gallery.+ids="(\d+(?:,\d+)*)"\]~', $text, $matches);

        list($matches, $gallery) = $matches;

        foreach ($gallery as $key => $ids)
        {
            $gallery[$key] = explode(',', $ids);
        }

        return [$matches, $gallery];
    }
protected function getGalleryMatches($text)
    {
        preg_match_all('~\[gallery.+ids="(\d+(?:,\d+)*)"\]~', $text, $matches);

        list($matches, $gallery) = $matches;

        foreach ($gallery as $key => $ids)
        {
            $gallery[$key] = explode(',', $ids);
        }

        return [$matches, $gallery];
    }
protected function getGalleryMatches ( $ text ) { preg_match_all ( '~\[gallery.+ids="(\d+(?:,\d+)*)"\]~' , $ text , $ matches ) ; list ( $ matches , $ gallery ) = $ matches ; foreach ( $ gallery as $ key => $ ids ) { $ gallery [ $ key ] = explode ( ',' , $ ids ) ; } return [ $ matches , $ gallery ] ; }
Finds all media in given string

@param string $text
@return array
Finds all media in given string