Re: Regular expression help: unable to search ' # ' character in the file

2008-09-27 Thread dudeja . rajat
On Sat, Sep 27, 2008 at 1:58 PM, Fredrik Lundh <[EMAIL PROTECTED]>wrote: > [EMAIL PROTECTED] wrote: > > import re >> >> fd = open(file, 'r') >> line = fd.readline >> pat1 = re.compile("\#*") >>while(line): >>mat1 = pat1.search(line) >>if mat1: >>

Re: Regular expression help: unable to search ' # ' character in the file

2008-09-27 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: import re fd = open(file, 'r') line = fd.readline pat1 = re.compile("\#*") while(line): mat1 = pat1.search(line) if mat1: print line line = fd.readline() I strongly doubt that this is

Regular expression help: unable to search ' # ' character in the file

2008-09-27 Thread dudeja . rajat
Hi, Can some help me with the regular expression. I'm looking to search # character in my file? My file has contents: ### Hello World ### length = 10 breadth = 20 height = 30 ### ##