| | 74 | $months=array("Jan"=>"01","Feb"=>"02","Mar"=>"03","Apr"=>"04","May"=>"05","Jun"=>"06","Jul"=>"07","Aug"=>"08","Sep"=>"09","Oct"=>"10","Nov"=>"11","Dec"=>"12"); |
|---|
| | 75 | |
|---|
| | 76 | /** |
|---|
| | 77 | * match "escaped quotes" or "everything except quotes" |
|---|
| | 78 | * |
|---|
| | 79 | * this might represent a significant performance hit |
|---|
| | 80 | */ |
|---|
| | 81 | $noquote = '(?:(?:(?<=\\\)")|(?:[^"]))*'; |
|---|
| | 82 | |
|---|
| | 83 | // Exemple de ligne apache : |
|---|
| | 84 | // crawl18.dir.com - login [14/Jun/2004:06:38:47 +0200] "GET /modules/newbb?days=100 HTTP/1.0" 200 20156 "-" "Pompos/1.3 http://dir.com/pompos.html" 2 esperance-jeunes.org |
|---|
| | 85 | |
|---|
| | 86 | // this pattern should match it |
|---|
| | 87 | $pattern = '/^[^ ]* [^ ]* [^ ]* \\[([0-9]*)\\/([a-zA-Z]*)\\/([0-9]*):[0-9]*:[0-9]*:[0-9]* [^ ]* "'.$noquote.'" ([0-9-]*) ([0-9-]*) "'.$noquote.'" "'.$noquote.'" [0-9]* ([^ ]*)$/'; |
|---|
| | 88 | |
|---|
| 103 | | |
|---|
| 104 | | |
|---|
| 105 | | $months=array("Jan"=>"01","Feb"=>"02","Mar"=>"03","Apr"=>"04","May"=>"05","Jun"=>"06","Jul"=>"07","Aug"=>"08","Sep"=>"09","Oct"=>"10","Nov"=>"11","Dec"=>"12"); |
|---|
| 106 | | |
|---|
| 107 | | /** |
|---|
| 108 | | * match "escaped quotes" or "everything except quotes" |
|---|
| 109 | | * |
|---|
| 110 | | * this might represent a significant performance hit |
|---|
| 111 | | */ |
|---|
| 112 | | $noquote = '(?:(?:(?<=\\\)")|(?:[^"]))*'; |
|---|
| 113 | | |
|---|
| 114 | | // Exemple de ligne apache : |
|---|
| 115 | | // crawl18.dir.com - login [14/Jun/2004:06:38:47 +0200] "GET /modules/newbb?days=100 HTTP/1.0" 200 20156 "-" "Pompos/1.3 http://dir.com/pompos.html" 2 esperance-jeunes.org |
|---|
| 116 | | |
|---|
| 117 | | // this pattern should match it |
|---|
| 118 | | $pattern = '/^[^ ]* [^ ]* [^ ]* \\[([0-9]*)\\/([a-zA-Z]*)\\/([0-9]*):[0-9]*:[0-9]*:[0-9]* [^ ]* "'.$noquote.'" ([0-9-]*) ([0-9-]*) "'.$noquote.'" "'.$noquote.'" [0-9]* ([^ ]*)$/'; |
|---|