On 1/12/07, Dan Drake <dan at dandrake.org> wrote:
> then a percent sign: "^\s*%"). But in the middle of the verbatim
> environment, it shouldn't interpret anything as comments -- so I'd like

Dan,

I don't understand why you'd want to waste cpu cycles checking a
regular expression if you know that you are either in the "verbatim
environment" or not, which you imply you know if you can switch re
objects.

If you're using readlines() on the file object to parse it, couldn't
you simply set a flag when you find the start of your verbatim section
and unset the flag when you find the end? Then as long as that flag is
set you'd simply call "continue" to get to the next line after
checking for the end of the verbatim section.

How do you know that you're in the "verbatim environment"?

Cheers!

Eric