lua-users home
lua-l archive

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

The manual does not specify the behavior of empty matches.  Example:

print(string.find("hello", "z*"))
1    0
print(string.find("hello", "z*", 4))
4    3

I think this makes perfect sense (works well with string.sub), but it
wasn't predictable (how can the occurrence end before it starts?).
Clarifying that the second return value will be the position found
minus one would be really nice.