note 35802 rejected from function.preg-match by didou
| From: | didou@php.net | Date: | Mon, 15 Sep 2003 11:58:16 +0000 |
| Subject: | note 35802 rejected from function.preg-match by didou | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-56520@lists.php.net to get a copy of this message | ||
Note Submitter: sbechtold@spoerle.com
----
Can anybody help me with this here:
i've got lines from the webalizer logfile and i want to split it using preg_match for each
line.
the lines are like this:
12.15.44.57 - - [30/Jun/2003:23:34:24 +0200] "GET /text.css HTTP/1.1" 200 2528
104.15.52.52 - - [30/Jun/2003:23:34:24 +0200] "GET /images/buttongruenmitc.gif HTTP/1.1"
200 1656
103.214.154.9 - - [30/Jun/2003:23:34:24 +0200] "GET /images/buttongruenwissenc.gif
HTTP/1.1" 200 1643
The pattern i have created is like this:
/^([0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}) - - \[
([0-9]{2})\/([a-zA-Z]{3})\/([0-9]{4}):([0-9]{2}):([0-9]{2}):
([0-9]{2}) ([+-]{1}[0-9]{4})\] "(POST|GET){1} (.*?)
(HTTP/[0-9]{1,}\.[0-9]{1,})" ([0-9]{1,}) ([0-9]{1,})$/
But it's throwing an error:
Unknown modifier '[' in /www/admin/logs/test.php on line 5
who can help me with this problem?
thanks for any quotes, also via email