Guest User

Untitled

a guest
Oct 16th, 2018
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. if ("http://") in text or ("https://") in text:
  2.  
  3. import re
  4. links = ['yandex', 'This is yandex https://yandex.ru/',
  5. 'rambler', 'This is rambler http://rambler.ru/index.php']
  6. s_links = ' '.join(links)
  7.  
  8. pat = re.compile('https?://S+[w/]')
  9. print(re.findall(pat, s_links)) # ['https://yandex.ru/', 'http://rambler.ru/index.php']
Add Comment
Please, Sign In to add comment