Quantcast
Viewing all articles
Browse latest Browse all 6

Answer by DonBaron for URL Validation function improving

Old thread but I think my amendments may be helpful to someone else landing here:

I didn't like to check only for a "www" as a hostname, nowadays we may encounter different hostnames... Thus I extended the Regex with:

"((?:http|https)://)?(?:[A-Za-z0-9]{1,25}\\.)?[\\w\\d\\-_]+\\.\\w{2,3}(\\.\\w{2})?(/(?<=/)(?:[\\w\\d\\-./_]+)?)?"

Viewing all articles
Browse latest Browse all 6

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>