$re = '/((?=.*?)(Google|Amazon)( (.+?))? is the largest( web)? service( of its kind)? in the world)*/ms';
$str = 'Google Search is the largest service of its kind in the world
Google Analytics is the largest service of its kind in the world
Blah de blah de blah
Yahoo search is the largest web service of its kind in the world
Google Maps is the largest service of its kind in the world
More blah
Amazon Shopping is the largest web service of its kind in the world
Google is the largest web service in the world
';
$subst = "";
$result = preg_replace($re, $subst, $str);
echo "The result of the substitution is ".$result;
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