just out of curiosity...

Terrence M. Brannon (brannon@jove.cs.caltech.edu)
Thu, 2 Jul 92 16:32:48 PDT

TeX section headers have the following format:

\section{Using Nitroglycerin in the Home}

the following works:

#!/tmp/python

import os, string, sys , regex

sect_regex = regex.compile('^.*\\section{\(.+\)+}.*$')
def main():
p = open(sys.argv[1] , 'r')
total, d = None, {}
for line in p.readlines():
if (sect_regex.match(line) != -1):
print line

main()

but changing the regex to
sect_regex = regex.compile('^\\section{\(.+\)+}.*$')

fails which implies that there is something at the front of the line
that I cannot see . any idea what?

--
terrence brannon
brannon@jove.cs.caltech.edu