title: Split a string in java using balanced parantheses
body: <p>I need to split the following string 
  ((OPERATING_CARRIER='AB' OR OPERATING_CARRIER='AB' OR (OPERATING_CARRIER='VA'    AND (FLIGHT_NO=604 OR FLIGHT_NO=603))))
  to :</p>
  
  <pre><code>OPERATING_CARRIER='AB'
  OPERATING_CARRIER='AB'
  OPERATING_CARRIER='VA'
  FLIGHT_NO=604
  FLIGHT_NO=603
  </code></pre>
  
  <p>I have tried the following piece of code</p>
  
  <pre><code>String syntax = "(OPERATING_CARRIER='AB' OR OPERATING_CARRIER='AB' OR     (OPERATING_CARRIER='VA' AND (FLIGHT_NO=604 OR FLIGHT_NO=603)))";
  List &lt; String &gt; matchList = new ArrayList &lt; String &gt; ();
  Pattern regex = Pattern.compile("\\(([^)]*)\\)");
  Matcher regexMatcher = regex.matcher(syntax);
  while (regexMatcher.find()) 
  {
      matchList.add(regexMatcher.group(1));
      System.out.println(regexMatcher.group(1));
  }
  </code></pre>
  
  <p>I am getting an output of OPERATING_CARRIER='AB' OR OPERATING_CARRIER='AB' OR (OPERATING_CARRIER='VA' AND (FLIGHT_NO=604 OR FLIGHT_NO=603</p>