"
^(?<scheme>[a-zA-Z][a-zA-Z0-9-+.]*)://(?:(?<username>(?:[\w-]|%\d\d)+)(?::(?<passwd>(?:[\w-]|%\d\d)*))?@)?(?<host>(?:[a-zA-Z][a-zA-Z0-9-]*\.?)+|\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})(?<port>:\d+)?(?<path>(?:/(?:[\w-.:]|%\d\d)+)+/?|/)?(?<query>\?(?:(?:[\w-]|%\d\d)+(?:=[\w]+)?(?:&|$))*)?(?<fragment>#.*)?$
"
mg