title: Retrieve data attribute value using preg_match
body: <p>I have the following HTML:</p>
  
  <pre><code>&lt;div class="video cover" data-thumb="https://i.vimeocdn.com/video/1234567.webp?mw=700&amp;amp;mh=393" style="background-image: url(https://i.vimeocdn.com/video/525930392.webp?mw=700&amp;amp;mh=393);"&gt;
  </code></pre>
  
  <p>I would like to retrieve the <code>data-thumb</code> URL value.</p>
  
  <p>I have attempted to retrieve the value using the following:</p>
  
  <pre><code>$iframe = '&lt;div class="video cover" data-thumb="https://i.vimeocdn.com/video/1234567.webp?mw=700&amp;amp;mh=393" style="background-image: url(https://i.vimeocdn.com/video/525930392.webp?mw=700&amp;amp;mh=393);"&gt;';
  
  preg_match('/data-thumb="(.*?)"/', $iframe, $matches);
  
  echo $matches[0];
  </code></pre>
  
  <p>However, this is not retrieving any matches.</p>
  
  <p><strong>EDIT: Thank you for your help and answers. It appears I made an error with the output of $iframe, which was displaying content from an iframe (doh). So preg_match couldn't target it.</strong></p>