$re = '/((?<=cachorro )corre\w+|(?<=cachorro )foi|(?<=cachorro )pul\w+)|((?<=gato )corre\w+|(?<=gato )foi|(?<=gato )dorm\w+)/';
$str = 'O cachorro correu com o gato
O carro passou e o cachorro foi atrás
Sempre que chego em casa meu cachorro pula em mim
Ele foi correndo atrás do sonho
Enquanto o gato correu
O cachorro dormiu
Despois disso o gato dormiu';
preg_match_all($re, $str, $matches, PREG_SET_ORDER, 0);
// Print the entire match result
var_dump($matches);
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for PHP, please visit: http://php.net/manual/en/ref.pcre.php