Answer the question
In order to leave comments, you need to log in
Regex - How to get the site address from a string?
There are many lines like this:
www.site.ru [email protected] +7 926 33-2222-11123 Москва
Answer the question
In order to leave comments, you need to log in
I killed 2.5 hours on the regular season, but nothing happened. Here I thought logically, and in 1 minute I threw it:
string = 'www.site.ru [email protected] +7 926 33-2222-11123 Москва'
contacts = string.split()
for contact in contacts:
if '.' in contact and not '@' in contact:
www = contact
print(www)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question