On Jun 23, 3:47 pm, Ian Kelly <ian.g.ke...@gmail.com> wrote:
> On Thu, Jun 23, 2011 at 1:58 PM, John Salerno <johnj...@gmail.com> wrote:
> > After I've run the re.search function on a string and no match was
> > found, how can I access that string? When I try to print it directly,
> > it's an empty string, I assume because it has been "consumed." How do
> > I prevent this?
>
> This has nothing to do with regular expressions. It would appear that
> page.read() is letting you read the response body multiple times in
> 2.x but not in 3.x, probably due to a change in buffering.  Just store
> the string in a variable and avoid calling page.read() multiple times.

Thank you. That worked, and as a result I think my code will look
cleaner.
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to