fixed a bug where url with hostname port number will break url regex.