title: Use preg_replace() to Isolate Number in Source Code
body: <p>I am trying to pick out a single value (in this instance, the value is 544007664) from the source code of a page that I am pulling of YouTube. Right now, the script that I have is successfully loading the source code from the YouTube page and removing the "&lt;" and ">" symbols so that when I echo the source code, it displays as text and doesn't display the page itself. The two preg_replace() functions (here on lines 4 and 5) that pull out everything before and after the desired value are not doing what I expect them to do.</p>
  
  <p>The only thing I can think of is that preg_replace() is refusing to read as a single string text that is in reality several dozens of individual lines.</p>
  
  <pre><code>&lt;?php
  $str = file_get_contents('https://www.youtube.com/watch?v=5XR7naZ_zZA');
  $str = $str;
  $str = preg_replace('~^(.)+(meta name="twitter:app:id:ipad" content=")~', '', $str);
  $str = preg_replace('~(" meta name="twitter:app:url:iphone")+(.)$~', '', $str);
  $str = preg_replace('~&lt;~', '', $str);
  $str = preg_replace('~&gt;~', '', $str);
  echo $str;
  ?&gt;
  </code></pre>
  
  <p>Any help is greatly appreciated.</p>