_,_,last = string.find(str,'(^\n]*$)') which produces nil
Try: print(string.find(buffer,'([^\n]*)$')) --rb