title: Extract all groups after character with regex
body: <p>The goal is to extract all the pairs <em>key/value</em> from a string which has the following format:</p>
  
  <p><code>(&amp;(foo=bar)(goo=car))</code> or <code>(|(foo=bar)(goo=car)(hoo=dar))</code></p>
  
  <blockquote>
    <p>I don't know how much groups are there, could be 2, could be 50.</p>
  </blockquote>
  
  <p>I need to extract the operator (<em>&amp; or |</em>) and the single params.</p>
  
  <p>I tried the following regex, but it ignores the first group:</p>
  
  <p><code>([|&amp;])((\(.*?=.*?\)))+</code></p>
  
  <p>How can I get all the groups?</p>
  
  <p><a href="https://regex101.com/r/vK4pN8/23" rel="nofollow noreferrer">my attempt</a></p>
  
  <p><strong>EDIT</strong></p>
  
  <p>I think I might got it working by applying 2 regexps</p>
  
  <p><code>\(([|&amp;])(.*)\)</code></p>
  
  <p>this will extract only the content</p>
  
  <p><code>(foo=bar)(goo=car)</code></p>
  
  <p>and this would extract the content</p>
  
  <p><code>\((.*?)\)</code></p>
  
  <p><code>foo=bar, goo=car</code></p>