\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