Ver original$txt = ' @marca país #numero [tipo de modo][CT:13/TT:5] by midominio.com ';$rgx = '/(@.+?\[.+?\])/'; var_dump(preg_match($rgx, $txt, $matches), $matches);