$re = '/:\/\/(?!(.+\.)?(meinedomaineins\.de|meinedomainzwei\.de)).+\.php/m';
$str = 'http://www.fremdedomain.de/index.php soll gefiltert werden
http://www.meinedomaineins.de/index.php soll durchkommen.
http://www.meinedomainzwei.de/index.php soll durchkommen.
<a href="https://www.nochirgendeinedomain.com/site/redirect.php?url=https%3A%2F%2Fwww.irgendeinedomain.com%2Fde%2FFsubmit%2F1%2F&utm_source=DE_BB_2017Q3&utm_medium=email&utm_campaign=allg&utm_content=rebox_ancillary">
';
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