I have seen many regular expressions for validating URLs. In my case, I want Url to be simpler, so the regex should be tougher:
Valid url prefixes are as follows:
- HTTP [s]: [. WWW] [?] // addressOrIp [.something] /PageName.aspx
The prefix is โโdescribed here. I will add ?x=a&y=b&z=clater. I just want to check if the web page is alive before accessing it, but before that I want to make sure that it is configured correctly. I want to refer to the conditions bad urland host is downin different ways, though, if in doubt, I'd rather give a message host is down, because that is the ultimate test in any case. Hope this makes sense. I suppose I'm trying to say that the regular expression should not be too aggressive, I just want it to cover 95% of cases.
This is C # -centric, so Perl regex extensions don't help me; let them adhere to the lowest common denominator.
Thank!
source
share