The interesting thing here is that the regex for urls does not allow spaces. But Javascript's test() method for regex returns true if is testing a string that contains substrings that match the regex (and those substrings are only separated by whitespace.)