Find & Replace hyperlinks in a string

Nico Grubert nicogrubert at gmail.com
Tue Nov 27 02:37:50 EST 2007


Hi there,

I have a string containing some hyperlinks. I'd like to replace every 
hyperlink with a HTML style link.

Example:
--------
Replace
   'http://www.foo.com/any_url'
with
   '<a href="http://www.foo.com/any_url">http://www.foo.com/any_url</a>'


What's the best way to do this if I have a few hundret strings to check?

Thanks in advance,
Nico



More information about the Python-list mailing list