Last modified: 2012-08-29 16:09:52 UTC
string.find function only return a number instead of an array. Some examples: string.find("d'alfdf", "(al)") return 3 instead of {3, 4, "al"} = string.find("d'alfdf", "^([a-d'])") return 1 instead of {1, 1, d} Lua manual say : string.find (s, pattern [, init [, plain]]) Looks for the first match of pattern in the string s. If it finds a match, then find returns the indices of s where this occurrence starts and ends; otherwise, it returns nil. [...] If the pattern has captures, then in a successful match the captured values are also returned, after the two indices.
The following code: a, b, c = string.find("d'alfdf", "(al)") print(b) outputs 4 on mediawiki.org (at least in debug console).
Thanks a lot ! It's works find. Sorry for having wasted your time.