I got a typo in a URI, i.e. colon instead of period. Why URI::regexp pass that kind of URI? For example
"http://www,my.com" =~ /^#{URI::regexp}$/
gives you 0 which means, as far as I know, it's a correct one. But if I try to parse such a URI
URI.parse("http://www,my.com")
it raises URI::InvalidURIError
Why? And how can test a URI properly?