lua-users home
lua-l archive

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


Warning: need error checking, and change the BASIC
style variables!


function extractContents(s, pattern1, pattern2)
local a, b, d, c

	a, b = string.find (s, pattern1 )
	c, d = string.find (s, pattern2 )

	return string.sub(s, b+1, c-1)
end


To print the title of a html page (loaded on the
'page' variable):

print( extractContents(page, "<TITLE>", "</TITLE>"))

Hope this could be useful to someone...


--- Andrew Wilson <agrwagrw@gmail.com> escreveu:

> Sure, it would be useful, send the code snippet. 
> AGRW
> 
> On 5/31/06, Jose Marin <jose_marin2@yahoo.com.br>
> wrote:
> >
> > If it's useful to someon, I've solved today, using
> > string.find!
> >
> > Thanks for your tips, guys!
> >
> >
> >
> >
> >
> >
> 

__________________________________________________
Faça ligações para outros computadores com o novo Yahoo! Messenger 
http://br.beta.messenger.yahoo.com/