posted 19 years ago
Don't know if its being done with regular expressions, but the constructors of java.net.URL parses URLs against RFC2396 and throws a MalformedURLException if the URL is syntactically garbage. So easier than writing a regex., you could just try toi create a URL object and handle the exception.