URL replacement in text

Ryan Tracey ryant at thawte.com
Fri Jan 12 11:01:30 EST 2001


Hi 

Can anybody point me in the right direction on this one. I'd like to
pass a block of plain text (string) to a function and have that function
look for URLs and turn them into HTML URL tags and then return the
updated text, e.g.:

'blah http://www.foo.net/index.html blah' to 'blah <a
href="http://www.foo.net/index.html">http://www.foo.net/index.html</a>
blah'.

I'm looking at the re and regsub module docs but... I like to look at
examples ;-)

TIA.

Cheers,
Ryan



More information about the Python-list mailing list