[Gllug] matching strings in python

dudes dudes akam123 at hotmail.co.uk
Sun Oct 2 08:36:08 UTC 2011


Can someone kindly point me my mistake here in this code. I'm trying to search a file for 10000 OR 10001 (in python).

import re;

this= open("file", r)
for line in this:
   if re.match('(10000)' | '(10001)', line)
        print line

/*It doesn't give me any errors. However; doesn't find the 10000 OR 10001 */

thanks for your time

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.lug.org.uk/pipermail/gllug/attachments/20111002/120cf3ac/attachment.html>
-------------- next part --------------
Gllug mailing list  -  Gllug at gllug.org.uk

More information about the GLLUG mailing list