lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


ketmar wrote:
On Tue, 17 Jun 2008 14:43:46 +0200
"daniel rahmeh" <daniel.rahmeh@gmail.com> wrote:

my original query is: Insert into sometable (username, password,
phone) values ('test', 'tespasswd', '123456789')

i want my query to be modified to: Insert into sometable (username,
password, phone) values ('test', SHA1('tespasswd'), '123456789')
maybe something like this:
res = query:gsub("values%s*%('[^']*',%s*%(('[^']*')%)", "SHA1(%1)");

This works better:

res = query:gsub("(values%s*%('[^']*',%s*)('[^']*')", "%1SHA1(%2)")