fork download
  1. import re
  2. pattern = r"""(?:https?:\/\/|ftps?:\/\/|www\.)(?:(?![.,?!;:()]*(?:\s|$|"))[^\s"]){2,}"""
  3. print(re.findall(pattern, input()))
Success #stdin #stdout 0.03s 9684KB
stdin
<!DOCTYPE html> <html lang="ru"><head prefix="og: http://o...content-available-to-author-only...p.me/ns# fb: http://o...content-available-to-author-only...p.me/ns/fb# article: http://o...content-available-to-author-only...p.me/ns/article# ya: http://w...content-available-to-author-only...x.ru/vocabularies/"><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><script> Возможно, http://сайт.рф? Ну или http://сайт.рф?id=67 - вроде парсится Ну и не без www.google.ru.
stdout
['http://o...content-available-to-author-only...p.me/ns#', 'http://o...content-available-to-author-only...p.me/ns/fb#', 'http://o...content-available-to-author-only...p.me/ns/article#', 'http://w...content-available-to-author-only...x.ru/vocabularies/', 'http://сайт.рф', 'http://сайт.рф?id=67', 'www.google.ru']