note 54696 added to function.preg-match
| From: | ian at remove-this dot mecnet dot net | Date: | Wed, 13 Jul 2005 02:26:13 +0000 |
| Subject: | note 54696 added to function.preg-match | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-91840@lists.php.net to get a copy of this message | ||
Linux kernel 2.6.11 changed the format of /proc/net/ip_conntrack. I have updated the regular
expression mark@portinc.net created in a comment below so that his function works again.
// Updated this regular expression for kernel 2.6.11 changes to /proc/net/ip_conntrack
$GREP = '!([a-z]+) ' .// [1] protocol
'\\s*([^ ]+) ' .// [2] protocl in decimal
'([^ ]+) ' .// [3] time-to-live
'?([A-Z_]|[^ ]+)?' .// [4] state
' src=(.*?) ' .// [5] source address
'dst=(.*?) ' .// [6] destination address
'sport=(\\d{1,5}) ' .// [7] source port
'dport=(\\d{1,5}) ' .// [8] destination port
'packets=(.*?) ' .// [9] num of packets so far
'bytes=(.*?) ' .// [10] num of bytes so far
'src=(.*?) ' .// [11] reversed source
'dst=(.*?) ' .// [12] reversed destination
'sport=(\\d{1,5}) ' .// [13] reversed source port
'dport=(\\d{1,5}) ' .// [14] reversed destination port
'packets=(.*?) ' .// [15] reversed num of packets so far
'bytes=(.*?) ' .// [16] reversed num of bytes so far
'\\[([^]]+)\\] ' .// [17] status
'mark=(.*?) ' .// [18] marked?
'use=([0-9]+)!'; // [19] use
----
Manual Page -- http://www.php.net/manual/en/function.preg-match.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+54696
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+54696&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+54696&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+54696&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+54696&report=yes&reason=useless
Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+54696&report=yes&reason=non-english
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+54696&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+54696&report=yes
Search -- http://master.php.net/manage/user-notes.php