title: regex match multiple text in either single or double quote
body: <p>I want to match strings like:</p>
  
  <pre><code>The two sentences are 'He said "Hello there"' and "She said 'goodbye' and 'another sentence'"
  </code></pre>
  
  <p>where each sentence is delimited by either single or double quotes, and can contain the opposite double or single quotes inside the sentence.</p>
  
  <p>The regex should return 2 matches - 1 for each sentence. For the example above:</p>
  
  <pre><code>He said "Hello there"
  She said 'goodbye' and 'another sentence'
  </code></pre>
  
  <p>The following regex gets close:</p>
  
  <pre><code>^The two sentences are (?:'|")(.*)(?:'|") and (?:'|")(.*)(?:'|")$
  </code></pre>
  
  <p>But because the first expression group is greedy up to any single or double quote, the above example actually returns:</p>
  
  <pre><code>He said "Hello there"' and "She said 'goodbye
  another sentence'
  </code></pre>
  
  <p>It would be really easy if I do something like:</p>
  
  <pre><code>^The two sentences are ('|")(.*)\1 and ('|")(.*)\3$
  </code></pre>
  
  <p>But then I also get back the matches for the capture groups - so I get back 4 matches - a single quote, the 1st sentence, a double quote, the 2nd sentence.</p>
  
  <p>Any good ideas on how to do this sort of thing (matching start and end of string delimiters) while "throwing away" the delimiter matches before returning just what was matched inside the delimited strings?</p>