<?php $strings = [ '141.243.1.172 [29:23:53:25] "GET /Software.html HTTP/1.0" 200 233', '[29:23:53:25] "GET /Software.html HTTP/1.0" 200 233', '"GET /Software.html HTTP/1.0" 200 233' ]; $pattern = '/(^.*?)?(\[[0-9]+:[0-9]+:[0-9]+:[0-9]+\] )?(".+?") ([0-9]+) ([0-9-]+)/'; foreach ($strings as $string) { preg_match($pattern, $string, $matches); print_r($matches); }
You have javascript disabled. You will not be able to edit any code.