title: How to use regex to match multiple paragraphs?
body: <p>I would like to process the html from a webpage and extract the paragraphs that match my criteria. The flavor of regex is PHP.</p>
  
  <p>This is the sample webpage HTML:</p>
  
  <pre><code>&lt;div class="special"&gt;
      &lt;p&gt;Some interesting text I would like to extract&lt;/p&gt;
      &lt;p&gt;More interesting text I would like to extract&lt;/p&gt;
      &lt;p&gt;Even more interesting text I would like to extract&lt;/p&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>The regex looks between the <code>&lt;div class="special"&gt;</code> and <code>&lt;/div&gt;</code> tags and puts everything into a capture group or variable for reference in the next step. This next step is what I am having trouble with. I cannot for the life of me write a regex that captures each paragraph of text between <code>&lt;p&gt;</code> and <code>&lt;/p&gt;</code>. </p>
  
  <p>I have tried <code>/&lt;p&gt;(.+?)&lt;\/p&gt;/s</code> which returns: </p>
  
  <pre><code>&lt;p&gt;Some interesting text I would like to extract&lt;/p&gt;
  &lt;p&gt;More interesting text I would like to extract&lt;/p&gt;
  &lt;p&gt;Even more interesting text I would like to extract&lt;/p&gt;
  </code></pre>
  
  <p>I would like each paragraph to be returned <strong>individually</strong> as items in an array. The non greedy <code>?</code> does not seem to work. Any suggestions?</p>