Category: Lua

Lua regex / string helpers

Match empty parenthesis pair, such as () or ( ), you use the pattern ‘%(%s*%)’ ‘[0-9]’ is simpler when written as ‘%d’, ‘[0-9a-fA-F]’ is the same as ‘%x’ .                    all characters %a                letters %c           

Continue Reading →

difference between lua find and c++ find

Lua: string.find(“testthis”, 5,5,7) this is going to give you “th”. Meaning it will start from the 5th letter and give the next letters between 5 and 7. C++ / C string str=”testthis” str.find(5,5); this will start from the fifth element and give you the next 5 letters. Basically in lua, it gives the letters between

Continue Reading →