compare a url string or object to a url pattern to find matches