title: RegExp match word with parenthesis?
body: <p>I have problem with regular expressions. I have strings like this:</p>
  
  <pre><code>test(r), testtest(r,r), example, example2, exmp (r,5)
  </code></pre>
  
  <p>I would like to find all words without blanks between text and the parenthesis. From the string above, I want to get:</p>
  
  <pre><code>test(r), testtest(r,r)
  </code></pre>
  
  <p>I created this regexp but it catches only brackets with content inside:</p>
  
  <pre><code>/\(([^\)]+)\)/g
  </code></pre>
  
  <p>Thanks for all answers.</p>
  
  <p>Edit:
  I am working in Ruby, and this regex works perfectly <code>/\w+\(([^)]+)\)/g</code>.</p>
  
  <p>What should I do if I would like to separate words with commas between brackets and without? For example how do I get this?</p>
  
  <pre><code>testtest(r,r) &lt;-with comma
  test(r) &lt;-without comma
  </code></pre>