Pattern-match & Replace - help required

AT matifayaz at gmail.com
Wed Dec 19 11:42:26 CET 2012


Hi,

I am new to python and web2py framework. Need urgent help to match a pattern in an string and replace the matched text.

I've this string (basically an sql statement):
stmnt = 'SELECT  taxpayer.id, 
         taxpayer.enc_name, 
         taxpayer.age,
         taxpayer.occupation
         FROM taxpayer WHERE (taxpayer.id IS NOT NULL);'

The requirement is to replace it with this one:
r_stmnt = 'SELECT  taxpayer.id, 
           decrypt(taxpayer.enc_name), 
           taxpayer.age,
           taxpayer.occupation
           FROM taxpayer WHERE (taxpayer.id IS NOT NULL);'

Can somebody please help?

Thanks & Regards
 




More information about the Python-list mailing list