lua-users home
lua-l archive

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

On Fri, Jan 29, 2016 at 4:49 AM, Cezary H. Noweta <> wrote:
> thus it is a good idea to open files in a binary mode and to treat \r\n as
> \n internally, or, simply, to treat \r as the last char of a line. There is
> no problem to operate on/produce canonically terminated lines in files under
> Windows.

And as I don't believe \r by itself is used by any modern operating
system, an easy pattern to match all modern line endings is '\r?\n'.
Plug that into a larger pattern however you want.