> When i specify i only want to print the lines that contains "string" ie > the first line and not the others. If i use re module, how to compile > the expression to do this? I tried the re module and using simple > search() and everytime it gives me all the 3 lines that have "string" > in it, whereas i only need line 1.
That's because all three lines DO include the substring "string" -- http://mail.python.org/mailman/listinfo/python-list