lua-users home
lua-l archive

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


You could try string.find(a, "(", true) to turn on plain text finding. Otherwise, you need to be aware of patterns and captures.

Robby

On Jul 7, 2012 5:52 PM, <meino.cramer@gmx.de> wrote:
Hi,

I did this interactively after I had the same behaviour
in my script.

    Lua 5.1.4  Copyright (C) 1994-2008 Lua.org, PUC-Rio
    > a="find(test)"
    > =string.find(a,"test")
    6   9
    > =string.find(a,"(" )
    stdin:1: unfinished capture
    stack traceback:
        [C]: in function 'find'
        stdin:1: in main chunk
        [C]: ?
>

Why does string.find find the word "test" but not the "(" ?

Best regards,
mcc