title: How can I match a quote-delimited string with a regex?
body: <p>If I'm trying to match a quote-delimited string with a regex, which of the following is "better" (where "better" means both more efficient and less likely to do something unexpected):</p>
  
  <pre><code>/"[^"]+"/ # match quote, then everything that's not a quote, then a quote
  </code></pre>
  
  <p>or</p>
  
  <pre><code>/".+?"/   # match quote, then *anything* (non-greedy), then a quote
  </code></pre>
  
  <p>Assume for this question that empty strings (i.e. "") are not an issue. It seems to me (no regex newbie, but certainly no expert) that these will be equivalent. </p>
  
  <p><strong>Update</strong>: Upon reflection, I think changing the <code>+</code> characters to <code>*</code> will handle empty strings correctly anyway.</p>