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]


steve donovan <steve.j.donovan@gmail.com> [12-07-07 19:04]:
> On Sat, Jul 7, 2012 at 6:51 PM, <meino.cramer@gmx.de> wrote:
> > Why does string.find find the word "test" but not the "(" ?
> 
> Because '(' is a 'magic character' in string patterns. If you say
> string.find(s,'(',1,true) then it does a plain search.
> 
> steve d.
> 
Thanks to all for the answers! :) This list is as fast and 
user friendly as Lua itsself :))))
If "(" is magic...
Is it possible to find the string, which is enclosed in "()"...for
example
a="indentifier(StringOfUnknownLength)"
=string.find(a, <insert magic here> )
13 33
???
Best regards,
mcc

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