]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MINOR: lua: Add tokenize function.
authorThierry FOURNIER / OZON.IO <thierry.fournier@ozon.io>
Thu, 24 Nov 2016 19:48:38 +0000 (20:48 +0100)
committerWilly Tarreau <w@1wt.eu>
Thu, 24 Nov 2016 20:35:34 +0000 (21:35 +0100)
commit8a1027aa45a8f79c3a1cb5ddaa3c691ae4caf6ad
treed62ccf37b5fac7ad5eadb6b41dcec712650de614
parent7f3aa8b62f645fb2e60158fa5e4129ed5e7a8ef4
MINOR: lua: Add tokenize function.

For tokenizing a string, standard Lua recommends to use regexes.
The followinf example splits words:

   for i in string.gmatch(example, "%S+") do
      print(i)
   end

This is a little bit overkill for simply split words. This patch
adds a tokenize function which quick and do not use regexes.
doc/lua-api/index.rst
src/hlua_fcn.c