Sir, Over your question I sent a suggestion that you may kindly refer to Alan Gauld's python Tutorial in http://www.freenetpages.co.uk/hp/alan.gauld/. But the mail bounced. I sent the mail to bangpypers@python.org I have joined the mailing list quite new so I do not know exactly why it bounced. I felt you are looking for the answer so I gave you a copy. It has nothing to do other than the answer, so sorry for sending you a copy. But if you can kindly guide me how to answer in the forum I would be immensely helpful. Best Regards, Subhabrata Banerjee.
On Tue, Mar 22, 2011 at 4:30 PM, <bangpypers-requ...@python.org> wrote: > Send BangPypers mailing list submissions to > bangpypers@python.org > > To subscribe or unsubscribe via the World Wide Web, visit > http://mail.python.org/mailman/listinfo/bangpypers > or, via email, send a message with subject or body 'help' to > bangpypers-requ...@python.org > > You can reach the person managing the list at > bangpypers-ow...@python.org > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of BangPypers digest..." > > > Today's Topics: > > 1. Re: Regular Expressions (Nitin Kumar) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Tue, 22 Mar 2011 13:25:35 +0530 > From: Nitin Kumar <nitin.n...@gmail.com> > To: Bangalore Python Users Group - India <bangpypers@python.org> > Subject: Re: [BangPypers] Regular Expressions > Message-ID: > <AANLkTinRFPbo_Uz6WBi0dbW-fDX5ok6JEghFf=suo...@mail.gmail.com> > Content-Type: text/plain; charset=ISO-8859-1 > > use this way > > r'(/|\\)cmd\.com$' > > Its raw string stuff which i guess you are missing out. > > Nitin K > > On Wed, Mar 16, 2011 at 11:27 PM, Santhosh Edukulla < > santhosh.eduku...@gmail.com> wrote: > > > Hi All, > > > > I have a list of regular expressions under a file(EX: inp.txt). Then, I > > have > > another file (EX: search.txt).The task is that i have to read the list of > > regular expressions from the inp.txt and then search for the same in > > "search.txt" and output the matched string. > > > > Iam using python *"re" *module to do this. > > > > This works except for few regular expressions below. > > > > *a = '(/|\\)cmd\.com$'* > > > > 1. > > When i read the regular expression above from the file to a variable > *(EX: > > a)*. as below > > EX: > > *a=open('inp.txt','r').readlines()[0]* > > > > Iam getting a different regular expresson as *'(/|\\\\)cmd\.com$'* > > > > 2. Instead when i use *a.encode('string-escape')*, iam getting the output > > for a as * '(/|\)cmd\.com$' *So when used like this, re.compile() > statement > > gives an error > > > > > > Any idea to solve this. > > > > Thx, > > Santhosh > > > > > > Thx, > > Santhosh > > _______________________________________________ > > BangPypers mailing list > > BangPypers@python.org > > http://mail.python.org/mailman/listinfo/bangpypers > > > > > > -- > Nitin K > > > ------------------------------ > > _______________________________________________ > BangPypers mailing list > BangPypers@python.org > http://mail.python.org/mailman/listinfo/bangpypers > > > End of BangPypers Digest, Vol 43, Issue 13 > ****************************************** > -- SUBHABRATA BANERJEE PDF(2007-2010)[IISc, Bangalore] Call:09873237945 _______________________________________________ BangPypers mailing list BangPypers@python.org http://mail.python.org/mailman/listinfo/bangpypers