lua-users home
lua-l archive

Re: How can I do PCRE-y stuff in Lua Patterns?

[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, '1円ACTION %11円'))

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

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

AltStyle によって変換されたページ (->オリジナル) /