I have a bunch of files in a directory which have hashes as below:
%some_hash =
(
...
)
%some_other_hash =
(
...
)
along with a bunch of other stuff in the file. I am listing the files in that directory and reading them in a loop. I want to extract only the above data, everything in the brackets alongwith the %word before it. Of course there can be brackets inside as well. Basic regexes i tried do not work. They split text in between since it finds a bracket.
I am using re.findall so i get everything for a file in a list.