Question about parsing a string
Nico Grubert
nicogrubert at gmail.com
Mon Oct 10 03:53:35 EDT 2005
Hi there,
I would like to parse a string in Python.
If the string is e.g. '[url=http://www.whatever.org][/url]' I would like
to generate this string:
'<a href="http://www.whatever.org">http://www.whatever.org</a>'
If the string is e.g. '[url=http://www.whatever.org]My link[/url]' I
would like to generate this string:
'<a href="http://www.whatever.org">My link</a>'
Any idea how I can do this? Maybe with regular expressions?
Thanks in advance,
Nico
More information about the Python-list
mailing list