title: Matching opening and closing quote in JavaScript (simple quotes)
body: <p>I wanted to change all the simple quotes ("…") of a string to smart quotes (“…”):</p>
  
  <pre><code>str.replace(/"/g,'“');
  </code></pre>
  
  <p>But then I realized that, in order to do it, I have to match the opening and closing quote, something like this:</p>
  
  <pre><code>str.replace(/REGEX_FOR_OPENING_QUOTES/g,'“');
  str.replace(/REGEX_FOR_CLOSING)_QUOTES/g,'”');
  </code></pre>
  
  <p>What regex should I use in this case?</p>