RE Question

Victor Subervi victorsubervi at gmail.com
Sun Aug 2 17:22:20 EDT 2009


Hi;
How do I search and replace something like this:
aLine = re.sub('[<]?[p]?[>]?<font size="h' + str(x) + '"[
a-zA-Z0-9"\'=:]*>[<]?[b]?[>]?', '<h' + str(x) + '>', aLine)
where RE *only* looks for the possibility of "<p>" at the beginning of the
string; that is, not the individual components as I have it coded above, but
the entire 3-character block?
TIA,
Victor
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20090802/276ec40a/attachment.html>


More information about the Python-list mailing list