note 86396 added to function.preg-match

From: Date: Thu, 16 Oct 2008 14:21:10 +0000
Subject: note 86396 added to function.preg-match
Groups: php.notes 
Request: Send a blank email to php-notes+get-145425@lists.php.net to get a copy of this message
@ 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. ;-) ---- Server IP: 208.69.120.35 Probable Submitter: 64.195.253.50 ---- Manual Page -- http://www.php.net/manual/en/function.preg-match.php Edit -- https://master.php.net/note/edit/86396 Del: integrated -- https://master.php.net/note/delete/86396/integrated Del: useless -- https://master.php.net/note/delete/86396/useless Del: bad code -- https://master.php.net/note/delete/86396/bad+code Del: spam -- https://master.php.net/note/delete/86396/spam Del: non-english -- https://master.php.net/note/delete/86396/non-english Del: in docs -- https://master.php.net/note/delete/86396/in+docs Del: other reasons-- https://master.php.net/note/delete/86396 Reject -- https://master.php.net/note/reject/86396 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#145425) next »