Is there a way to check whether a regular expression represents a valid URL ? Say, the regular expressions are Java Strings, is there a way to check whether these Strings represent a valid URL?
For e.g., say
String s1 = "/amazon\.com\//";
String s2 = "/google(\.[a-z]+)?\.[a-z]+\/search.*q=/i";
String s3 = "/.*/"; //Represents any URL
String s4 = "hello world";
s1, s2, and, s3 are valid regular expressions representing Urls but s4 is invalid.
Thanks, Sony