I'm writing a .NET 3.5 app and using URI.IsWellFormedUriString(string uriString, UriKind uriKind)
to verify user-inputted URIs; using UriKind.Absolute
. I was just playing with the application and I'm a bit worried and confused as to why something like:
is a valid URI? What gives? I know it's because it's part of the RFC, but why is it valid in the first place?
The only time I've ever seen URIs like that is for corporate, internal Intranets like
or
http://localhost (which is very popular, but also a special case)
I do not want to have to use my own regular expression as there are so many varying URI regexs. However, I do not really want users entering URIs like that that aren't publically accessible.
Any idea or thoughts? Thanks.