title: Matching Apache access log line regex php
body: <p>I need to parse an apache log line:</p>
  
  <p>Here's what I've tried:</p>
  
  <pre><code>$line = '136.243.36.82 - - [30/Apr/2016:17:00:20 -0700] "GET /Socialist/06/0609Educ.htm HTTP/1.1" 200 3093 "-" "Mozilla/5.0 (compatible; BLEXBot/1.0; +http://webmeup-crawler.com/)" "redlug.com"';
  
  $regex = '/^(\S+) (\S+) (\S+) \[([^:]+):(\d+:\d+:\d+) ([^\]]+)\] \"(\S+) (.*?) (\S+)\" (\S+) (\S+) "([^"]*)" "([^"]*)"$/';
  
  preg_match($regex, $line, $match);
  
  die(var_dump($match));
  </code></pre>
  
  <p>But it always returns an empty array.</p>