title: regular expression to match the text inside a div but ignore the child elements if they exist
body: <p>I am trying to match the string that is contained inside a <code>&lt;div&gt;</code>
  the issue is I need to ignore anything inside of any child elements within the div, I cant seem to get it to match how I need it to.</p>
  <p>I have to keep a 3 part format in the regex namely <code>/^()(.*?)()$/</code> where</p>
  <ul>
  <li><code>()</code> matches the left side</li>
  <li><code>(.*?)</code> matches the area that I want to
  capture</li>
  <li><code>()</code> matches the right side.</li>
  </ul>
  <p>the left and right sides are the starting and stopping points.</p>
  <p>lets say I have this HTML:</p>
  <pre><code>&lt;div class=&quot;some stuff&quot;&gt;Could Be Anything&lt;span class=&quot;specifics&quot;&gt;Huge&lt;/span&gt;&lt;/div&gt;
  </code></pre>
  <p>now I need to pull out the &quot;Could Be Anything&quot; from the HTML example given without the &quot;Huge&quot; from the child element. following the 3 part rules.</p>
  <p><strong>NOTE:</strong> the <code>&lt;div</code> could not have any child elements.. it could just be text (which i want) or text and child elements</p>
  <p>my attempt was <code>/^(&gt;)(.*?)(&lt;span)$/</code> but that didn't work, and I don't know where to go from here. any help would be appreciated!</p>
  <h3>EDIT:</h3>
  <p>for a more clear picture of what I am trying to do.</p>
  <p>I am trying to return some sports stats from a webpage. i'm using kimonolabs to scrape a webpage. the element i'm trying to scrape is a  inside a table. this  contains a  that has some text inside it. kimono uses css selectors to know which element to pull from. and then regex is an option to filter anything else. so right now if the div has another element inside it it returns that elements text aka the 's text but I don't want that</p>