title: Capture with single quotes In triple quoted string
body: <p>Suppose this regexp in Javascript:</p>
  
  <pre><code>/(?:"""([\s\S]*?)""")/g
  </code></pre>
  
  <p>How could I make it, so that both of the following captures work?</p>
  
  <pre><code>"""foo"""
  </code></pre>
  
  <p>to capture:</p>
  
  <pre><code>foo
  </code></pre>
  
  <p>but also...</p>
  
  <pre><code>"""foo "bar baz""""
  </code></pre>
  
  <p>to capture:</p>
  
  <pre><code>foo "bar baz"
  </code></pre>
  
  <p>?</p>
  
  <p><strong>Note:</strong> Atm I wouldn't know how to capture the second example.</p>
  
  <p>Put differently, I need to make sure that the final quote in what I want to capture does not break the triple quote pattern, i.e. match the first three triple quotes only rather than the last three.</p>