I am trying to extract all words within nested parentheses by using regex. Here is an example of my .txt
file:
hello ((
(alpha123_4rf)
45beta_Frank))
Red5Great_Sam_Fun
I have tried this with regex:
r'[\((?\(??(^\()?\))]'
but have not been able to get the desired output. I want my output to be like this:
((
(alpha123_4rf)
45beta_Frank))
What am I doing wrong? Any help is greatly appreciated!