Ver originalpreg_match_all('/(.*) \((.*)\)\s*(.*)/', $str, $matches); if(isset($matches[3][0]) && substr($matches[3][0], 0, 6) == 'Chrome') { preg_match_all('/(.*) \((.*)\) (.*) \((.*)\) (.*)/', $str, $matches);}