On Wed, Dec 19, 2012 at 02:42:26AM -0800, AT wrote:
> Hi,
> 
> I am new to python and web2py framework. Need urgent help to match a
> pattern in an string and replace the matched text.
> 

Well, what about str.replace then?

>>> 'egg, ham, tomato'.replace('ham', 'spam, ham, spam')
'egg, spam, ham, spam, tomato'


If the pattern you want to match is more complicated, have a look at
the re module!

Regards,
        Thomas.
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to