note 86396 deleted from function.preg-match by danbrown

From: Date: Wed, 03 Aug 2011 13:11:53 +0000
Subject: note 86396 deleted from function.preg-match by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-182152@lists.php.net to get a copy of this message
Note Submitter: Jonathan Camenisch ---- @ Marc A little more work to do--your expression matched ...256... through ...259..., and will not match 1- or 2-digit numbers that do not start with 1. It could also be a little more concise, as in: /^(1?\d{1,2}|2([0-4]\d|5[0-5]))(\.(1?\d{1,2}|2([0-4]\d|5[0-5]))){3}$/ Also, I put together a primitive regex tester at http://j-r.camenisch.net/regex/ -- to help someone find more flaws to correct. ;-)

« previous php.notes (#182152) next »