blob: 59cca12b94f8d53f5e511a4fe8e6f1f4bd93eaef (
plain)
1
2
3
4
5
6
7
8
9
|
assert(string.match("alo xyzK", "(%w+)K") == "xyz")
assert(string.match("254 K", "(%d*)K") == "")
assert(string.match("alo ", "(%w*)$") == "")
assert(string.match("alo ", "(%w+)$") == nil)
assert(string.find("(�lo)", "%(�") == 1)
local a, b, c, d, e = string.match("�lo alo", "^(((.).).* (%w*))$")
assert(a == '�lo alo' and b == '�l' and c == '�' and d == 'alo' and e == nil)
a, b, c, d = string.match('0123456789', '(.+(.?)())')
assert(a == '0123456789' and b == '' and c == 11 and d == nil)
|