title: RegEx for checking multiple matches
body: <p>I want to match all occurrence in string.</p>
  <h3>Example:</h3>
  <pre><code>pc+pc2/pc2+pc2*rr+pd
  </code></pre>
  <p>I want to check how many matched of <code>pc2</code> value and regular expression is <code>before and after special character</code> exists.</p>
  <pre><code>var str = &quot;pc+pc2/pc2+pc2*rr+pd&quot;; 
  var res = str.match(new RegExp(&quot;([\\W])pc2([\\W])&quot;,'g'));
  </code></pre>
  <p>But I got only <code>+pc2/</code> and <code>+pc2*</code> and <code>/pc2+</code> not get in this.</p>
  <p>Problem is in first match <code>/</code> is removed. So after that, it is starting to check from <code>pc2+pc2*rr+pd</code>. That's why <code>/pc2+</code> value does not get in the match.</p>
  <p>How do I solve this problem?</p>