lua-users home
lua-l archive

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

Eike Decker wrote:

I am trying to find a regular expression that matches each line of an input
string but cannot find an expression that needs no additional checks.

1-st method:
for line in (str.."\n"):gmatch("([^\n]*)\n") do

2-nd method (using split from Lrexlib):
for line in rex.split(str, "\n") do

(various flavors of split can be written in Lua, of course).