I have a string like
set arr_set(variable.abc) {12,13}
set arr_set(variable.def) {15,16}
set arr_set(dont_care) {0,0}
where arr_set is an array set, and variable_abc
is an element of it. I have all this information stored in a file. What I want to do is, read each line, and wherever I see "variable." I read what it is pointing to, like in first case, it is pointing to abc
, and then def
.
I wrote this script, but it is apparently not storing the information.
regexp -nocase {^\s*set arr_set[(]variable\s*.\s*(.*)$} $lines match tag value
where lines
is the string that contains
set arr_set(variable.abc) {12,13}
I cant figure out what is the regex missing here. Can anyone take a look?