title: How to extract the operands on both sides of "==" using regex?
body: <h2>Language and package</h2>
  <p>python3.8, regex</p>
  <h2><strong>Description</strong></h2>
  <p>The inputs and wanted outputs are listed as following:</p>
  <blockquote>
  <p>if (programWorkflowState.getTerminal(1, 2) == Boolean.TRUE) {</p>
  </blockquote>
  <p>Want: <code>programWorkflowState.getTerminal(1, 2)</code> and <code>Boolean.TRUE</code></p>
  <blockquote>
  <p>boolean ignore = !_isInStatic.isEmpty() &amp;&amp; (_isInStatic.peek() == 3) &amp;&amp; isAnonymous;</p>
  </blockquote>
  <p>Want: <code>_isInStatic.peek()</code> and <code>3</code></p>
  <blockquote>
  <p>boolean b = (num1 * ( 2 + num2)) == value;</p>
  </blockquote>
  <p>Want: <code>(num1 * ( 2 + num2))</code> and <code>value</code></p>
  <h2><strong>My current regex</strong></h2>
  <p><code>((?:\((?:[^\(\)]|(?R))*\)|[\w\.])+)\s*==\s*((?:\((?:[^\(\)]|(?R))*\)|[\w\.])+)</code></p>
  <p>This pattern want to match <code>\((?:[^\(\)]|(?R))*\)</code> or <code>[\w\.]</code> on both side of &quot;==&quot;</p>
  <p><a href="https://i.stack.imgur.com/DG9AO.png" rel="nofollow noreferrer">Result on regex101.com</a></p>
  <p><strong>Problem</strong>: It failed to match the recursive part <code>(num1 * ( 2 + num2))</code>.</p>
  <p>The explanation of the recursive pattern <code>\((?:m|(?R))*\)</code> is <a href="https://stackoverflow.com/questions/26385984/recursive-pattern-in-regex">here</a></p>
  <p>But if I only use the recursive pattern, it succeeded to match <code>(num1 * ( 2 + num2))</code> as the <a href="https://i.stack.imgur.com/dMHtt.png" rel="nofollow noreferrer">image</a> shows.</p>
  <p>What's the right regex to achieve my purpose?</p>