[Tutor] returning the entire line when regex matches

Nick Burgess burgess.nick at gmail.com
Sun May 3 22:42:49 CEST 2009


How do I make this code print lines NOT containing the string 'Domains'?


import re
for line in log:
    if re.search (r'Domains:', line):
        print line


This does not work...

if re.search != (r'Domains:', line):


More information about the Tutor mailing list