Replaced the URL matching with a regex pattern