Can a single regex be used to valdate urls and match all the parts, I have been working on one and what I have come up with so far is:
(?:(?P[a
Modified version of mingfai's regular expression:
/^((?Phttps?|ftp):\/)?\/?((?P.*?)(:(?P.*?)|)@)?(?P[^:\/\s]+)(?P:([^\/]*))?(?P(\/\w+)*\/)(?P[-\w.]+[^#?\s]*)?(?P\?([^#]*))?(?P#(.*))?$/