# coding=utf8
# the above tag defines encoding for this document and is for Python 2.x compatibility
import re
regex = r"https?://([^.]+)"
test_str = "https://a...content-available-to-author-only...a.net:666/api/v1/"
matches = re.search(regex, test_str)
if matches:
print(matches.group(1))
IyBjb2Rpbmc9dXRmOAojIHRoZSBhYm92ZSB0YWcgZGVmaW5lcyBlbmNvZGluZyBmb3IgdGhpcyBkb2N1bWVudCBhbmQgaXMgZm9yIFB5dGhvbiAyLnggY29tcGF0aWJpbGl0eQoKaW1wb3J0IHJlCgpyZWdleCA9IHIiaHR0cHM/Oi8vKFteLl0rKSIKCnRlc3Rfc3RyID0gImh0dHBzOi8vYS4uLmNvbnRlbnQtYXZhaWxhYmxlLXRvLWF1dGhvci1vbmx5Li4uYS5uZXQ6NjY2L2FwaS92MS8iCgptYXRjaGVzID0gcmUuc2VhcmNoKHJlZ2V4LCB0ZXN0X3N0cikKCmlmIG1hdGNoZXM6CglwcmludChtYXRjaGVzLmdyb3VwKDEpKQogICA=