I have a .lua file where there are stored tables in this format:
["f@someFaction - someServer@guildVaults"] = {
["someStr1"] = {
["someStr2"] = 7,
["someStr3"] = 2
}
["someStr4"] = {
["someStr5"] = 7,
["someStr6"] = 2
}
}
Basically there can be any number of nested tables. I know the names of the initial table that I'm looking to extract, however, I have trouble extracting the subsequent table.
with open("somePath", "rb") as file:
f = file.read()
pattern = r"\[\"f@[a-zA-z]+ - [a-zA-z]+@guildVaults\"\] = \{[ \t\n]*"
guildVaults = re.findall(pattern, f)
for guild in guildVaults:
print guild
Results:
["f@Alliance - Thunderhorn@guildVaults"] = {
["f@Alliance - Proudmoore@guildVaults"] = {
["f@Alliance - Kazzak@guildVaults"] = {
["f@Horde - Draenor@guildVaults"] = {
Any suggestions?
Edit: example of the .lua file here: http://www.pastefile.com/Tx2LVD