The backslash is a special character used for quoting both in String literals and in regexes. So a single backslash in a regex pattern needs to be represented by four, not two, backslashes in a String literal.

Your \\( in a String literal becomes \( in the resulting String, thus quoting the left parenthesis and resulting in the error you posted: the right parenthesis is unmatched because the left parenthesis was treated as a literal (

Apart from all that, if your requirement was correctly expressed, what you tried was horribly complicated ;)