lua-users home
lua-l archive

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

On 2017-10-01 03:44 PM, Egor Skriptunoff wrote:

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".

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

I think you forgot the second gsub that makes it look italics to me. The one with the goal of making it look like "test /thing/" instead of "test/thing/".

I also want "test <<thing>> test" to become "test test" with a separate "thing" in an action (even if that action is between the 2 "test"), not "testtest" with a "thing" action.

(But perhaps I should claim clients that display "test \1ACTION thing\1 test" as "*thing\x0Atest\x20\x20test" are wrong...)

Disclaimer: these emails may be made public at any given time, with or without reason. If you don't agree with this, DO NOT REPLY.