title: How do I get the values into my variables from the following regex PHP?
body: <p>I need to parse a big log file to get the ipadress, datetime, source and client from all the records.</p>
  
  <p>The following link with the regex works:</p>
  
  <p><a href="http://regex101.com/r/cG9tY7" rel="nofollow">http://regex101.com/r/cG9tY7</a></p>
  
  <p>Regex: </p>
  
  <pre><code>(?&lt;ipAddress&gt;.*?)\s-\s-\s\[(?&lt;dateTime&gt;.*?)\]\s\"GET\s(?&lt;source&gt;.*?)\"\s[0-9]+\s[0-9]+\s\"-\"\s\"(?&lt;client&gt;.*?)\"
  </code></pre>
  
  <p>Maybe the format is not ok for PHP ?</p>
  
  <p>I open the file as such:</p>
  
  <pre><code>$filename = "access-streaming_small.log"
  $file = popen("tac $filename", 'r');
  </code></pre>
  
  <p>If I use :</p>
  
  <pre><code>while ($line = fgets($file)) {
  echo $line;
  }
  </code></pre>
  
  <p>I get the full log file which is displayed ok.</p>
  
  <p>I need to process it with regex so that I get variables of ipadress, datetime, source and client from all records contained in the log file. 
  Bonus task: I need to filter results to get the most current details of the records generated in the last 10 minutes compared to current time.</p>