obspy.clients.fdsn.client.Client.URL_REGEX

Client.URL_REGEX = 'https?://((?:(?:25[0-5]|2[0-4]\\d|[0-1]?\\d{1,2})(?:\\.(?:25[0-5]|2[0-4]\\d|[0-1]?\\d{1,2})){3})|(?:\\[(?:[\\d,a-f]{4}|[1-9,a-f][0-9,a-f]{0,2}|0)(?::(?:[\\d,a-f]{4}|[1-9,a-f][0-9,a-f]{0,2}|0)){7}\\]|\\[(?:(?:[\\d,a-f]{4}|[1-9,a-f][0-9,a-f]{0,2}|0):){0,5}(?:[\\d,a-f]{4}|[1-9,a-f][0-9,a-f]{0,2}|0)::\\]|\\[::(?:[\\d,a-f]{4}|[1-9,a-f][0-9,a-f]{0,2}|0)(?::(?:[\\d,a-f]{4}|[1-9,a-f][0-9,a-f]{0,2}|0)){0,5}\\]|\\[::(?:[\\d,a-f]{4}|[1-9,a-f][0-9,a-f]{0,2}|0)(?::(?:[\\d,a-f]{4}|[1-9,a-f][0-9,a-f]{0,2}|0)){0,3}:(?:(?:25[0-5]|2[0-4]\\d|[0-1]?\\d{1,2})(?:\\.(?:25[0-5]|2[0-4]\\d|[0-1]?\\d{1,2})){3})\\]|\\[(?:[\\d,a-f]{4}|[1-9,a-f][0-9,a-f]{0,2}|0):(?:(?:[\\d,a-f]{4}|[1-9,a-f][0-9,a-f]{0,2}|0):|:(?:[\\d,a-f]{4}|[1-9,a-f][0-9,a-f]{0,2}|0)){0,4}:(?:[\\d,a-f]{4}|[1-9,a-f][0-9,a-f]{0,2}|0)\\])|localhost|\\w(?:[\\w-]*\\w)?|(?:\\w(?:[\\w-]{0,61}[\\w])?\\.){1,}([a-z][a-z0-9-]{1,62}))(?::\\d{2,5})?(/[\\w\\.-]+)*/?$'

Regex for checking the validity of URLs