I am using the following regex to match a URL:
$search = \"/([\\S]+\\.(MUSEUM|TRAVEL|AERO|ARPA|ASIA|COOP|INFO|NAME|BIZ|CAT|COM|INT|JOBS|NET|ORG|PRO|TEL|AC|A
$ : The dollar signifies the end of the string. For example \d*$ will match strings which end with a digit. So you need to add the $!