I need to modify a string using REGEX in js that too in two ways
1) Operators(AND|OR) in string must have a leading and trailing whitespace ie if say string is
(C1 AND C2 ORC3) AND (C4OR C5) then must be modified to (C1 AND C2 OR C3) AND (C4 OR C5)
2) parenthesis must not have whitespace in between them and also with conditions(Cn) ie
( ( C1 AND C2 OR C3) ) AND ( C4 OR C5) then it must be modified to ((C1 AND C2 OR C3)) AND (C4 OR C5)