For python, the string '\\' contains one (1) backslash (`\'). So
regexp.compile just sees the sequence `\sectio<...etc.>', and depending
on the kind of regexp library, mode, and program you are working with,
the backslash might be thrown away, generates an error, or means "match
a character whose syntax belongs to the code `e' (see Emacs syntax
codes)."
I tested the next part of code, and it works:
sect_regex = regex.compile('^\\\\section{\\(.+\\)}.*$')
Watch also the double backslashes before the braces. Hope this helps.
-- Jan-Hein Buhrman -- CWI, Amsterdam -- <jh@cwi.nl> --
NFS server (amd:109) not responding still trying
NFS server (amd:109) ok
/ufs/jh/lib/mottos: No such file or directory