title: Count parentheses with regular expression
body: <p>My string is: <code>(as(dh(kshd)kj)ad)... ()()</code></p>
  
  <p>How is it possible to count the parentheses with a regular expression? I would like to select the string which begins at the first opening bracket and ends before the <code>...</code></p>
  
  <p>Applying that to the above example, that means I would like to get this string: <code>(as(dh(kshd)kj)ad)</code></p>
  
  <p>I tried to write it, but this doesn't work:</p>
  
  <pre><code>var str = "(as(dh(kshd)kj)ad)... ()()";
  document.write(str.match(/(.*)/m));
  </code></pre>