Quantcast
Viewing latest article 4
Browse Latest Browse All 6

Answer by Josha Inglis for URL Validation function improving

This would be my attempt:

((?:http|https)://)?(?:www\\.)?[\\w\\d\\-_]+\\.\\w{2,3}(\\.\\w{2})?(/(?<=/)(?:[\\w\\d\\-./_]+)?)?

EDITAdded in a back-reference (?<=/)for extra specificity

EDIT 2Added optional search for country name in URL (eg www.google.com.in)


Viewing latest article 4
Browse Latest Browse All 6

Trending Articles



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