lua-users home
lua-l archive

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


> To make it work for 5.0, change '%d+,%d+' to '[%d,]+'.

Yes, sorry, I forgot to mention that.  Thanks.

With a sightly bigger (and uglier) change, it can be made to work in
both versions. Something like this (untested):

 local F,P
 if string.find(_VERSION,"Lua 5%.0") then
  P="^[mf].-<(.-):%d+>"
 else
  P="^[mf].-<(.-):%d+,%d+>"
 end

 ...
  local ok,_,f=string.find(s,P)

Or perhaps just change the pattern to this (also untested):
  local ok,_,f=string.find(s,"^[mf].-<(.-):%d+,?%d*>")

--lhf