When I run this code:
t = {}
s = "from=world, to=Lua"
for k, v in string.gmatch(s, "(%w+)=(%w+)") do
t[k] = v
end
for i,v in pairs(t) do Note(t[i]) end
I get output:
Lua
world
I am trying to learn regex so I can run this:
for v in io.lines([[speeds.txt]]) do
for k,w in string.gmatch(v,"pattern") do
-put each section into array
end
end
speeds.txt (I added the == trying to make some thing to match):
==1==Armory==Gueldar's Armory==2s3wn==
==2==Bakery==The Aylorian Eatery==2s3en==
==3==Bank==The Aylorian Bank of Ivar==11s==
I've been trying to regex for awhile now and noticed the output from the example above (taken from www) didn't seem to do what it was intended to do. So I figured I was missing something or using different syntax for patterns than MUSH.
t = {}
s = "from=world, to=Lua"
for k, v in string.gmatch(s, "(%w+)=(%w+)") do
t[k] = v
end
for i,v in pairs(t) do Note(t[i]) end
I get output:
Lua
world
I am trying to learn regex so I can run this:
for v in io.lines([[speeds.txt]]) do
for k,w in string.gmatch(v,"pattern") do
-put each section into array
end
end
speeds.txt (I added the == trying to make some thing to match):
==1==Armory==Gueldar's Armory==2s3wn==
==2==Bakery==The Aylorian Eatery==2s3en==
==3==Bank==The Aylorian Bank of Ivar==11s==
I've been trying to regex for awhile now and noticed the output from the example above (taken from www) didn't seem to do what it was intended to do. So I figured I was missing something or using different syntax for patterns than MUSH.