нечестный способ со сторонней библиотекой:
LPeg is a new pattern-matching library for Lua
http://www.playwithlua.com/?p=66

пример работы со строками:
https://www.lua.org/pil/11.6.html
https://www.lua.org/pil/20.html

The power of a raw Lua interpreter to manipulate strings is quite limited. A program can create string literals and concatenate them. But it cannot extract a substring, check its size, or examine its contents. The full power to manipulate strings in Lua comes from its string library.


http://lua-users.org/wiki/LuaUnicode

язык по умолчанию не поддерживает Unicode, но это исправляется с использованием специальной ICU библиотеки.


A Lua string is an arbitrary counted sequence of bytes (C chars of your compiler, so 8 bit or bigger). Lua does not reserve any value, including NUL, so arbitrary binary data, including unicode data, can be stored.

Отредактировано Лис (2018-10-11 07:25:31)