note 30703 added to function.preg-match

From: Date: Wed, 26 Mar 2003 09:07:35 +0000
Subject: note 30703 added to function.preg-match
Groups: php.notes 
Request: Send a blank email to php-notes+get-45838@lists.php.net to get a copy of this message
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); -- http://www.php.net/manual/en/function.preg-match.php http://master.php.net/manage/user-notes.php?action=edit+30703 http://master.php.net/manage/user-notes.php?action=delete+30703 http://master.php.net/manage/user-notes.php?action=reject+30703

« previous php.notes (#45838) next »