lua-users home
lua-l archive

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


On Wed, Mar 5, 2014 at 3:24 PM, Francisco Olarte <folarte@peoplecall.com> wrote:
> that I sanitize every pattern I use to see wether it
> starts with ^ or what?

Why not?

    if pattern:byte() == 94 -- anchored
        -- check once
    else
        -- search the whole string.
    end

-- Pierre-Yves