Recently encountered a problem with regular expression replacement
Each piece of data in the time data is preceded by [0]= [1]= [2]= [3]= this index:
["time"]={[0]={["status"]=true,["ac"]=1,["bg"]=2},[1]={["status"]=true,["ac"]=1,["bg"]=2},[2]={["status"]=true,["ac"]=1,["bg"]=2},}
Because the previous index is gone for some reasons, it can only be added using regular expressions. The problem is that the amount of data in time is different
["time"]={{["status"]=true,["ac"]=1,["bg"]=2},}
["time"]={{["status"]=true,["ac"]=1,["bg"]=2},{["status"]=true,["ac"]=1,["bg"]=2},}
["time"]={{["status"]=true,["ac"]=1,["bg"]=2},{["status"]=true,["ac"]=1,["bg"]=2},{["status"]=true,["ac"]=1,["bg"]=2},}
Is there a way to automatically add the sequence [0]= [1]= [2]= [3]=
Replenish:
The wrong data are together, and the data order in time is not the same, as follows:
["time1"]={{["status"]=true,["ac"]=1,["bg"]=2},},["time2"]={{["status"]=true,["ac"]=1,["bg"]=2},{["status"]=true,["ac"]=1,["bg"]=2},},["time3"]={{["status"]=true,["ac"]=1,["bg"]=2},{["status"]=true,["ac"]=1,["bg"]=2},{["status"]=true,["ac"]=1,["bg"]=2},}
Want to change it to:
["time1"]={[0]={["status"]=true,["ac"]=1,["bg"]=2},},["time2"]={[0]={["status"]=true,["ac"]=1,["bg"]=2},[1]={["status"]=true,["ac"]=1,["bg"]=2},},["time3"]={[0]={["status"]=true,["ac"]=1,["bg"]=2},[1]={["status"]=true,["ac"]=1,["bg"]=2},[2]={["status"]=true,["ac"]=1,["bg"]=2},}
It’s not well written, it’s funny