is it possible to have a regex that will find all regex condition statements?
This is what I have come up with so far
(?:[^\\][\(]\?:.+[\)])
but it does not work that well, it will just go until the last bracket in the statement, any help would be appreciated.
This is not possible in the general case, because the condition could contain arbitrarily nested pairs of
(). A single Java pattern cannot handle that; it requires a context-free grammar, whereas Java patterns can only implement regular grammars. (Well, mostly. A few bonus features, notably backreferences, allow grammars that are technically not regular, but they’re still not enough to let a single pattern handle nested parentheses.)