I wish to get all the the domain names in the given string using python. i have tried the below but i am not getting the o/p as expected
str = "ctcO6OgnWRAxLtu+akRCFwM asu.edu zOiV6Wo6nDnUhQkZO4XTySrTRwLMgozM9R/LyQs2r+Pb tarantino.cs.ucsb.edu,128.111.48.123 ssh-rsa 9SMF4U+qJW03Bh1"
list = re.findall(r'([a-zA-Z0-9]+(-[a-zA-Z0-9]+)*\.)+[a-z]{2,10}', str)
print list
I want the output as:
asu.edu , tarantino.cs.ucsb.edu
but what I get is:
[('asu.', ''), ('ucsb.', '')]
What am I missing ?
my_strandmy_listnames instead if you don't have any meaningful names for them