Regular expression for validating a url
:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9] )(? :[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9] )*(? Maybe try a DNS lookup for that host (although that's probably a terrible idea.) Alternatively, don't validate to that level.
In most of the cases, we tend to use regular expressions for validation.The best way to make sure that your URL is 100% valid is to make a request to the server and see what you get back. What you need to do is extract the host from the URL and then do some sort of validation there.These Regexs are examples and not built for a particular Regex engine. In particular, this means that character classes do not contain meta characters which need to be escaped, except the Regex Library Site A site that has a HUGE library of regular expressions and other regex resources Regex Tutorial Site A site with lots of tutorials on writing Regexs and numerous examples Regex Construction Tool A free regex construction tool Regex Explanation Tool A few days ago I was working on a blogging app that gave users the ability to create and save posts.