Like this...
Lus syntax error:[string " local count = 0..."]:19: 'end' expected (to close 'for' at line 4) near"
Lus syntax error:[string " local count = 0..."]:19: 'end' expected (to close 'for' at line 4) near"
You can do pretty much that with:Darmir wrote:I would like to see a table.match function.
Syntax: table.match(s,pattern,var1,var2,...varN,varN+1)
--
test to see if string s matches the given Pattern. If it matches, the position of the match in the string is returned (starting with 1). If it doesn't match, zero is returned. The optional VarN arguments contain the names of variables to store any captured subpatterns (subpatterns surrounded by parenthesis). The additional VarN+1 variable name can be specified to hold the length of the matched pattern.
Example:
table.match("Joe says Hi","(\w+) says (.*)",Name,Message,X)
displays 1 and sets the Name variable to "Joe", the Message variable to "Hi" and the X variable to 12.