title: preg_match_all regex
body: <p>Having issues using regex to grab HTML contained in a certain span.
  Trying to get it to get <code>safeytrfyh is available!</code> on NameMC.com to make a fast checker that will check a pre-specified list if usernames are available instead of constantly typing in the username and clicking check.</p>
  
  <p>An example page you guys can use is <code>https://namemc.com/u/safeytrfyh</code>
  Im using cURL for this:</p>
  
  <pre><code>&lt;?php
  //Urls to scrape from.
  $URLs = array();
  $URLs[] = 'https://namemc.com/u/safeytrfyh';
  $working = '';
  
  //Curl scraper.
  foreach($URLs as $URL){
  $ch     = curl_init();
  curl_setopt($ch, CURLOPT_URL, $URL);
  curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36');
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  curl_setopt($ch, CURLOPT_HEADER, 1);        
  curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
  $page = curl_exec($ch);
  $accounts = array();
  preg_match_all('#&lt;div&gt;&lt;span[^&gt;]*&gt;(.*?)&lt;/span&gt;&lt;/div&gt;#',$page,$accounts);
  foreach($accounts[0] as $account){
      $working .= ''.$account.''. PHP_EOL . '';
  }
  }
  
  //Put the scraped check into the new .txt file.
  file_put_contents('accounts.txt', $working, FILE_APPEND);
  ?&gt;
  </code></pre>