Extracts parts of an URL into regex groups:
((?:(?:http|ftp|ws)s?|sftp):\/\/?)?(group 1): extracts the protocol
(+\.+|localhost)(group 2): extracts the hostname
(:\d+)?(group 3): extracts the port number
((?:\/\w+)\/)?([\w\-.]++)?(groups 4 & 5)*: extracts the path part
(+)?(group 6): extracts the qu...
Submitted by Elie Grenon (elie-g) - 2 years ago