così farebbe più o meno quello che ti serve? re1 = re.compile(r'^\\begin\{description\}\n\\item\[\{([^\}]+)\}\] \\leavevmode\n(.*)\\end\{description\}$', re.M | re.S) re1.sub(r'\\begin{definizione}\n\\textbf{\1}\n\2\\end{definizione}',
Il 10 settembre 2013 13:31, Marco Beri <marcob...@gmail.com> ha scritto: > 2013/9/10 Daniele Zambelli <daniele.zambe...@gmail.com> >> >> >>> re1 = re.compile(r'\\begin{description}\n\\item\[\{([^\}]+)\}] >> >>> \\leavevmode([^(\\end{description})])\\end{description}', re.M) > > > Sono molto infognato e in questo momento non riesco a darti una mano, ma qui > stai facendo un errore. Non usare le raw string se usi il doppio backslash. > >>>> print r"\\b\n" > \\b\n > >>>> print "\\b\n" > \b > >>>> > > Ciao. > Marco. > > > _______________________________________________ > Python mailing list > Python@lists.python.it > http://lists.python.it/mailman/listinfo/python > _______________________________________________ Python mailing list Python@lists.python.it http://lists.python.it/mailman/listinfo/python