When I initially used URI.regexp and submitted file:stuff it accepted it as a valid uri with no scheme, which is why I went the additional step of validating that a scheme can correctly be pulled out of the uri instead of just using regexp.