lua-users home
lua-l archive

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

Isn't it strange what string.find returns when the initial search position is beyond the subject end:
  print(string.find("a", ".*", 10)) --> 2  1

BTW, when trying to write string.gmatch in pure Lua, using string.find, one should take this issue into consideration (and do an additional check).

So I propose that string.find return nil in this case.