|
On Mon, Jul 7, 2014 at 9:18 AM, Austin Einter <austin.einter@gmail.com> wrote:How about something really simple?
> Please note that, input string might have some data before or after of given
> example values.
local lens = input:match('^Content%-Length%s*:%s+(%d+)%s+$')
if lens then -- gotcha Content-length
len = tonumber(lens)
end
Note how '-' must be escaped...%s matches all whitespace, including line ends.