title: How do I get to know what part of a REGEX was activated?
body: <p>According to the following code example:</p>
  <pre><code>var s = &quot;This., -/ is #! an $ % ^ &amp; * example ;: {} of a = -_ string with `~)() punctuation&quot;;
  var punctuationless = s.replace(/[.,\/#!$%\^&amp;\*;:{}=\-_`~()]/g,&quot;&quot;);
  var finalString = punctuationless.replace(/\s{2,}/g,&quot; &quot;);
  </code></pre>
  <p>Given a random input 'var s',</p>
  <p><strong>How do I know which character was removed in the final string?</strong></p>
  <p>If I could collect the detected character in a variable, it would be awesome.</p>