Skip to content

Instantly share code, notes, and snippets.

@OlegKorn
Created August 31, 2021 02:34
Show Gist options
  • Save OlegKorn/0b3dcb011a871bdae4c9cb481f4d0644 to your computer and use it in GitHub Desktop.
Save OlegKorn/0b3dcb011a871bdae4c9cb481f4d0644 to your computer and use it in GitHub Desktop.
Python re findall websites
a = '''<a href="dfsdfdsfd" target="_blank" class="_1rehek">
сайт-сайт.рф</a>
</a>ваываыва4333.РФ
<div>www.dekorm.com</div>
https://wewefds.net
http://dsdfsdfs.org
www.fsdsdfsd.РФ
сайт.тест
сайт.домен
'''
re.findall(r'[\w.+-]+@[\w-]+\.[-\D]+', s)
>>>['сайт-сайт.рф', 'ваываыва4333.РФ', 'www.dekorm', 'wewefds.net', 'dsdfsdfs.org', 'www.fsdsdfsd', 'сайт.тест', 'сайт.домен']
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment