If I write string.find("test()","("), it give me the error "unfinished capture". Other Chars work. what can I do?
string.find with (
Started by Wilma456, Nov 28 2016 07:33 PM
3 replies to this topic
#1
Posted 28 November 2016 - 07:33 PM
#2
Posted 28 November 2016 - 07:43 PM
Because brackets are a special character in patterns you have to escape them.
("test()"):find "%("
#4
Posted 04 December 2016 - 04:25 PM
Redall, on 04 December 2016 - 01:49 PM, said:
That's "normal" Lua syntax. I don't see a reason why you should add brackets if you don't have to; You save time and space. In contrast, your code is "dirty": You are using semicola even though they have no "special" meaning in Lua. They are just there to comfort those who come from languages enforcing them so their habits won't break their code.
2 user(s) are reading this topic
0 members, 2 guests, 0 anonymous users











