title: Regex match multiple elements
body: <p>I have regex that I am trying to match to specific function parameters. I want to be able to style them a certain way in a language package.</p>
  
  <p>Here is the text I am trying to match:</p>
  
  <pre><code>addFill(path:svgjs.Element, pattern:Pattern, docMaxSide:number) {
      pathFillId(path)
  }
  </code></pre>
  
  <p>In this example, I want to match the words "path" "pattern" and "docMaxSide" from the parameters. I want to make sure it does NOT match the word "path" in the second line (where I am calling pathFillId).</p>
  
  <p>Here is my current regex: <code>\(.*?(\w+):.*?\)</code></p>
  
  <p>Broken down:</p>
  
  <p><code>\(</code> Find open parens</p>
  
  <p><code>.*?</code> It may have stuff before it, but after the parens</p>
  
  <p><code>(\w+):</code> Capture a word before a colon</p>
  
  <p><code>.*?</code> There may be more stuff after the colon</p>
  
  <p><code>\)</code> Close parens</p>
  
  <p>Right now, it will only match the first item, "path". But I need it to match all the words I mentioned above.</p>
  
  <p>UPDATE: I should have been more specific. It should only match if it's a function parameter. For example, I don't want <code>path1</code> matched in the following: <code>var path1:string</code>. The difficulty is coming up with regex that matches items only between parens.</p>