[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: string.find
- From: Louis Mamakos <louie@...>
- Date: Thu, 9 Oct 2008 11:26:13 -0400
On Thu, Oct 09, 2008 at 05:59:05PM +0300, ketmar wrote:
> On Thu, 9 Oct 2008 09:53:17 -0500
> "Jeff Wise" <email@example.com> wrote:
> > I have a Lua function that includes:
> > local s = string.find(buffer, ff)
> > The ff is defined as 0x0C (a form feed), and is a "special
> > character". The find is "finding" form feeds where there are none (as
> > verified with a hex editor). Is there a problem in using this string
> > function for finding special characters? If so, how do I search
> > buffer for a form feed?
> from manual:
> string.find (s, pattern [, init [, plain]])
> so you can try buffer:find(ff, 1, true) and see if anything changes.
> this will turn off Lua "pattern matching" and perform a simple
> substring search.
Perhaps your variable "ff" isn't what you think it is..
> str = "a"
> num = 97
> =string.find("foobar", str)
> =string.find("foobar", num)