"Bill Campbell" <[EMAIL PROTECTED]> wrote
to get regular expressions to match the font change sequences in
*roff input (e.g. \fB for bold, \fP to revert to previous font).
The re library maps r'\f' to the single form-feed character (as
it does other common single-character sequences like r'\n').

I think all you need is an extra \ to escape the \ character in \f

This does not work in puthon:

s = re.sub(r'\f[1NR]', '</emphasis>, sinput)

Try

s = re.sub(r'\\f[1NR]', '</emphasis>, sinput)

HTH,

--
Alan Gauld
Author of the Learn to Program web site
http://www.freenetpages.co.uk/hp/alan.gauld

_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to