\(([^\\(\\)]+)\)
My regex above captures everything between each set of brackets of the form
(Hello OR there) AND (big AND wide AND world)
I get
Hello OR there
big AND wide AND world
But it falls down when there are parentheses inside the terms within the brackets
(Hello OR there AND messing(it)up) AND (big AND wide AND world)
Returns
it
big AND wide AND world
Whereas I want
Hello OR there AND messing(it)up
big AND wide AND world
I'm not sure if that's possible with regex or what the best approach would be?