lua-users home
lua-l archive

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




On Sun, Oct 1, 2017 at 2:41 AM, Soni L. wrote:

local PATTERN = '%f[^ \0]<<([^ ].-)>>%f[ \0] ?'
    .. msg:gsub(PATTERN, '\1ACTION %1\1'))

And it works pretty good, except for e.g. "test <<thing>>" which gets sent as "test \1ACTION thing\1" and I'd rather it be sent as "test\1ACTION thing\1".

Try
PATTERN = ' *%f[^ \0]<<([^ ].-)>>%f[ \0] *'