fork download
  1. import re
  2. rx = r"//([^/]*\.[^/:]+)"
  3. strs = ["http://f...content-available-to-author-only...o.com/", "http://x...content-available-to-author-only...b.we--p1qw/vse_seeei_podryad/mqwetiki",
  4. "http://w...content-available-to-author-only...e.com/ru/", "http://e...content-available-to-author-only...y.to/%D0%qwewqeD0%BA%D1%83%D0%BD%D0%B8%D0%BD",
  5. "http://name@while.com", "http://n...content-available-to-author-only...x.into/v-vashem-aktive-net-inostrannyx-yazykov-ne-kruchintes",
  6. "http://f...content-available-to-author-only...t.com:80/books/90359"]
  7. for s in strs:
  8. m = re.search(rx, s)
  9. if m:
  10. print(m.group(1))
Success #stdin #stdout 0.04s 27712KB
stdin
Standard input is empty
stdout
fallertoo.com
xn----7sbjsadhgf0dd3k7b.we--p1qw
www.nice.com
exway.to
name@while.com
news.t-stilex.into
fib.mexeemat.com