[Tutor] string matching and replacement

Sean 'Shaleh' Perry shaleh@valinux.com
Thu, 07 Sep 2000 13:17:34 -0700 (PDT)


On 07-Sep-2000 Melissa Holden wrote:
> Thank you for your help.  This may be a dumb question, but is it possible to
> search a file?  For example, instead of string = '<!-- beginning text -->This
> is a comment<!-- ending text -->'
> m = p.search(string)
> I was trying to get it to search an external file that I had referenced
> earlier in the program by 
> file = open('../index5.html').read()
> 

I am sure with some playing you could do this.  The regex search has to have a
string to look thru though.