note 30703 deleted from function.preg-match by sniper
| From: | sniper@php.net | Date: | Tue, 30 Sep 2003 12:15:54 +0000 |
| Subject: | note 30703 deleted from function.preg-match by sniper | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-57401@lists.php.net to get a copy of this message | ||
Note Submitter: Pasdeloup
----
There is a bug on the regexp to test IP.
It doesn't accept 2xx numbers.
Here's my correction (some comas were misplaced), but I'm not a regexp expert so it can be
buggy too :
preg_match("/^(((([1-9])|([1-9][\d])|(1[\d]{2})|
(2[0-4][\d])|(25[0-4]))(\.(([\d])|([1-9][\d])|
(1[\d]{2})|(2[0-4][\d])|(25[0-4]))){3})|(0(\.0){3}))
$/",$myIp);