I am parsing a file that have entries like:
xxx-yy.biz. 39405 A 156.154.66.33
mail.global.com. 3464 A 115.113.9.64
xyx xyx xyx
webmail.xyz.com. 1463 A 115.113.9.64
gmail.com. 3464 A 115.113.9.22
I am trying to extact the URL and its IP address with string "mail" in it:
for line in (dnsfile):
match = re.search(r'(.*mail.*?)\s+(.*)\s+A\s+(.*)', line)
and match.group(1) and match.group(2) is giving me URL and IP.
I want to extent this search so that I don't want to parse public emails like: gmail, hotmail, yahoo,mail. More general : exclude a list of words in this search.