[Tutor] Sub

Michael Montagne Michael Montagne <montagne@boora.com>
Thu, 18 Jul 2002 17:09:32 -0700


>On 18/07/02, from the brain of Michael Montagne tumbled:

> Ok,
> I'm getting close now.  I've found the line and now I need to extract
> the score.
> scoreline='<td><font class="be">-4</font></td>' #the line I wanted
> s='<td><font class="be">(.*)</font></td>'
> e.sub(s,'\1',scoreline)
> 
> This should give me '-4' but it gives me \x01.  What is that?
> 
> I know I'm close!!
> 

It should be  re.sub(s,"\\1",scoreline)

Back in business!!


-- 
  Michael Montagne  [montagne@boora.com]   503.226.1575 
--