r'''
(?#First, match the protocol)
(?:https?|ftp)://
(?#Next, check for optional username and/or password)
(?#Note: The following two char classes are functionally equivalent)
(?:[\x21-\x39\x3b-\x3f\x41-\x7e]+(?::[!-9;-?A-~]+)?@)?
(?#Next, let's match the domain [with support for Punycode ])
(?:xn--[0-9a-z]+|[0-9A-Za-z_-]+\.)*(?:xn--[0-9a-z]+|[0-9A-Za-z-]+)\.(?:xn--[0-9a-z]+|[0-9A-Za-z]{2,10})
(?#Let's match on optional port)
(?::(?:6553[0-5]|655[0-2]\d|65[0-4]\d{2}|6[0-4]\d{3}|[1-5]\d{4}|[1-9]\d{1,3}|\d))?
(?#Next, let's match on