lua-users home
lua-l archive

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


This library [1] provides Lua5.1 string.* functions support for UTF8 strings.

local str = "пыщпыщ ололоо я водитель нло"
-- 8    26  ололоо я водитель 

print(str:gsub("ло+", "보라"))
-- пыщпыщ о보라보라 я водитель н보라 3

print(str:match("^п[лопыщ ]*я"))
-- пыщпыщ ололоо я

Although there are pattern classes that works only with ASCII codes: %a, %l, %p, %u, %w  it is useful enough.


P.S. It was written about 1.5 years ago, so this is kinda "late-announce"

С уважением, Алимов Степан Геннадьевич.