lua-users home
lua-l archive

Re: string.find does act differently based on input?

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


On Jul 7, 2012, at 12:51 PM, meino.cramer@gmx.de wrote:
>> =string.find(a,"(" )
> stdin:1: unfinished capture
> Why does string.find find the word "test" but not the "(" ?
You can escape the '(' character:
> return string.find("find(test)","%(")
5	5
e

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