This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
Creeper9207's profile picture

Match gets entire file

Started by Creeper9207, 08 April 2015 - 10:02 PM
Creeper9207 #1
Posted 09 April 2015 - 12:02 AM
data:match(":"..":"..file2..":"..":".."(.+)"..";/"..";"..file2..";"..";"):gsub("=n".."32", " ".."n")
sends the entire file, dunno why
side note: file2 is the name of a file

don't ask about the excessive ..s
Creator #2
Posted 09 April 2015 - 12:30 AM
What is it you are trying to find exactly. Be sure to throw a glance at this site to learn more about magic characters in lua. If you have any questions, be sure to ask. ;)/>
Creeper9207 #3
Posted 09 April 2015 - 03:20 AM
Im trying to get ::nu::hi;/;nu;;
Bomb Bloke #4
Posted 09 April 2015 - 10:35 AM
Despite being a mess, this works in about the manner I'd expect it to. Eg:

local data, file2 = "::nu::hi;/;nu;;", "nu"
print(data:match(":"..":"..file2..":"..":(.+);".."/;"..file2..";"..";"):gsub("=n".."32", " \ ".."n"))  --> "hi", 0

This isn't the same version of the line as in the paste you provided in your last thread about this exact same line, though, leading me to wonder what else you changed (… and why you didn't stick with that thread?!).
Edited on 09 April 2015 - 08:37 AM