[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: [string.gmatch] Getting rid of parentheses?
- From: Gilles Ganault <gilles.ganault@...>
- Date: Mon, 25 Jul 2011 10:53:45 +0200
Hello
Google didn't help to figure out why Lua returns found tokens between
parentheses:
=========
page = '<span>item1</span><br>(item2)<br>(item3)<br><i>'
for a,b in string.gmatch(page,
'<span>.-</span><br>(.-)<br>(.-)<br><i>') do
stuff = a .. b .. "\n"
print(stuff)
end
=========
Here's what the console says:
=========
(item2)(item3)
=========
What's the right way to extract tokens from a string without having
them displayed with parentheses?
Thank you.