lua-users home
lua-l archive

Re: pattern matching and replacing

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


On 2008年6月17日 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)");

AltStyle によって変換されたページ (->オリジナル) /