I'm want to match a domain (with preg_match) but I want to exclude a subdomain.
Example I want to match all subdomains on example.org except boon.example.org:
I've tried this:
$test = "boon.example.org";
$test2 = "null";
if(preg_match('#(?!boon)(\w+\.)?example\.org#', $test, $output)) {
$test2 = $output[2] .'example.org';
}
But the output of test2 is: oon.example.org and not example.org
Somebody has an answer?