lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


This behavior is as expected.

print(string.match("x", "[f]+"))
nil
print(string.match("x", "f"))
nil
print(string.match("x", "f+"))
nil


print(string.match("b", "ab"))
nil
print(string.match("b", "a+b"))
nil
print(string.match("b", "a*b"))
b

Using * where + is meant is a common error in Lua patterns and in regex-land.

    -Mark