heres my function
lua Code:
local lookupTable = {["g"] = "\|cffffd700g\|r", ["s"] = "\|cffc7c7c7s\|r", ["c"] = "\|cffeda55fc\|r"}
local stripTable = {["g"] = "", ["s"] = "", ["c"] = ""}
local staMon = "12g34s56c"
local staGold = string.gsub(staMon, "%a%s-", lookupTable)
for gold in string.gmatch(staMon, "%d+%g") do
strGold = string.gsub(gold, "%a", stripTable)
print(strGold.." goldvar")
end
for silver in string.gmatch(staMon, "%g%d+[^%s]") do
strSilver = string.gsub(silver, "%a", stripTable)
print(strSilver.." silvervar")
end
for copper in string.gmatch(staMon, "%d+[^%c]") do
strCopper = string.gsub(copper, "%a", stripTable)
print(strCopper.." coppervar")
end
my problem is line 14
no matter what I try I can't get it to match the "56c" in staMon ( line 4 )
it either matches on all 3 or it matches on nothing
any help getting this pattern match working would be greatly appreciated