title: Matching a substring between two special characters EXCLUDING the characters
body: <p>So I want to capture the sub-string between two special characters in JavaScript, using regular expressions.
  Say I have the string <code>"$Hello$, my name is $John$"</code>, I would want .match to return the array of <code>[Hello, John]</code>. 
  *In addition, I do not want to capture the match between two matches. So I wouldn't want to capture $, my name is $, since it is technically between two '$'s. </p>
  
  <p>The regular expression I have used is </p>
  
  <pre><code>var test = str.match(/(?&lt;=\$)(.*)(?=\$)/);
  </code></pre>
  
  <p>Which works, but duplicates each entry twice. So it has
  [Hello, Hello, John, John]. 
  I have also used <code>var test = str.match(/(?&lt;=\$)[^\$]+?(?=\$)/g)</code>
  But this returns everything inbetween each match (the example i listed above $, my name is $.)</p>
  
  <p>How can I fix this?</p>