Example text:
Code: Select all
Foods: burrito, soft-drink, burrito, soft-drink, burrito and burrito
Code: Select all
(\, |\: |and )(\w+)
foodtype = matches[3]
if foodtype == "burrito" then
burritocounter = burritocounter + 1
echo("burritos = "..burritocounter )
end
if foodtype == "soft-drink" then
softdrinkcounter = softdrinkcounter + 1
echo("softdrinks = "..softdrinkcounter)
end