I'm using this code to preg match for *.domain.com but need it changed to also include foreign domains which have a few periods like *.domain.co.uk. Any helps appreciated thanks
if (trim(preg_match('!^https?://([^/]+\.)?domain\.com(/|#|$)!i', $documentLink->getAttribute('href'))))
Just an update that i'm looking to match *.domain.(any TLD) not just co.uk
Thanks