title: Get the HREF from a link with a specific class
body: <pre><code>&lt;a data-track='' _sp= class=s-item__link href=get_this_href&gt;...&lt;/a&gt;
  </code></pre>
  <p>With the above link, the <code>data-track</code> contains some json data. The <code>_sp=</code> could contain numbers/letters and a period (.). The class is <code>s-item__link</code>.</p>
  <p>I would need the <code>get_this_href</code> and then I can go from there.</p>
  <p>This is the regex I tried... but im stuck from here.</p>
  <pre><code>&lt;a\b(?=[^&gt;]* class=&quot;[^&quot;]*(?&lt;=[&quot; ])s-item__link[&quot; ])(?=[^&gt;]* href=&quot;([^&quot;]*))
  </code></pre>
  <p>Here is an example: <a href="https://regex101.com/r/rVPeUI/1" rel="nofollow noreferrer">https://regex101.com/r/rVPeUI/1</a></p>
  <pre><code>$link = &quot;&quot;; //url im scraping
  $html = file_get_html($link);
  //find is part of simple_html_dom.php. im saying each li item is an $item.
  
  foreach ($html-&gt;find('li.s-item    ') as $item) {
      //$item contains the decent amount of nested divs with spans and links.
  }
  </code></pre>