Михаил yes, it is great optimalization. Thank you.
And,.. I can have a condition that would also create a variable?
Equivalent for:
var = re.find(hc.url, [[\.(htm|html|php|php3|php5|asp|aspx)(\?|$)]], 1)
if var then
hc.put_msg (1, 'Test ok: '..var)
end
Example idea:
url
http://www.domain.tld/index.phpif re.find(hc.url, [[\.(htm|html|php|php3|php5|asp|aspx)(\?|$)]], 1) then
--i dont know, maybe return? but i dont know parameters for return in this situation
end
To be output: php
--- --- ---
Example idea/solution from my coding, but not accepted in LUA:
if var=re.find(hc.url, [[\.(htm|html|php|php3|php5|asp|aspx)(\?|$)]], 1) then
hc.put_msg (1, 'Test ok: '..var)
end
or
if var:re.find(hc.url, [[\.(htm|html|php|php3|php5|asp|aspx)(\?|$)]], 1) then
hc.put_msg (1, 'Test ok: '..var)
end
or
if re.find(hc.url, [[\.(htm|html|php|php3|php5|asp|aspx)(\?|$)]], 1)>>var then
hc.put_msg (1, 'Test ok: '..var)
end
or
for var in re.find(hc.url, [[\.(htm|html|php|php3|php5|asp|aspx)(\?|$)]]) do
hc.put_msg (1, 'Test ok: '..var)
end
(sorry for maybe stupid idea/question)