title: RegExp - How can I match the shortest amount possible?
body: <p>I have my Regular Expression <code>/'(.*)(?:(?:'\s*,\s*)|(?:'\)))/</code><br>
  and my test code <code>('He said, "You're cool."' , 'Rawr')</code><br>
  (My test code simulates parameters being passed into a function.) <br>
  <br>
  I will explain my Regular Expression as I understand it and hopefully a few of you can shed some light on my problem. <br><br>
  1)<code>/'</code> means at the beginning of the matched string, there needs to be <code>'</code> <br><br>
  2)<code>(.*)</code> means capture any character except <code>\n</code> 0 or more times <br><br>
  3)<code>(?:(?:4)|(?:5))</code> means don't capture but try to do step 4 and if it doesn't work try step 5 <br><br>
  4)<code>(?:'\s*,\s*)</code> means don't capture but there needs to be a <code>'</code> with 0 or more whitespace characters followed by a <code>,</code> with 0 or more whitespace characters <br><br>
  5)<code>(?:'\))</code> means don't capture but there needs to be <code>')</code> <br><br>
  So it seems that it should return this (and this is what I want): <br>
  <code>'</code>+<code>He said, "You're cool."</code>+<code>' ,</code> <br>
  But it returns: <br>
  <code>'</code>+<code>He said, "You're cool."' , 'Rawr</code>+<code>')</code> <br><br>
  If I change my test code to <code>('He said, "You're cool."' , 'Rawr'</code> (no end parenthesis) it returns what I want, but as soon as I add that last parenthesis, then it seems that my OR operator does whatever it wants to. I want it to test first if there is a comma, and break there if there is one, and if there is not one check for a parenthesis. <br><br>
  I've tried switching the spots of step 4 and step 5, but still the OR operator seems to always default to the <code>(?:'\))</code> side. 
  <strong>How can I match the shortest amount possible?</strong></p>