note 86150 added to function.preg-match

From: Date: Mon, 06 Oct 2008 08:16:27 +0000
Subject: note 86150 added to function.preg-match
Groups: php.notes 
Request: Send a blank email to php-notes+get-145078@lists.php.net to get a copy of this message
@ Steve Todorov: Your regex will not only match 999.999... but also 9999.9999... etc. I'd rather take this regex: /^(1\d{0,2}|2(\d|[0-5]\d)?)\.(1\d{0,2}|2(\d|[0-5]\d)?) \.(1\d{0,2}|2(\d|[0-5]\d)?)\.(1\d{0,2}|2(\d|[0-5]\d)?)$/ this should represent any ip (v4). At least it did in a small test here ;) ---- Server IP: 212.124.37.9 Probable Submitter: 84.58.176.33 ---- Manual Page -- http://www.php.net/manual/en/function.preg-match.php Edit -- https://master.php.net/note/edit/86150 Del: integrated -- https://master.php.net/note/delete/86150/integrated Del: useless -- https://master.php.net/note/delete/86150/useless Del: bad code -- https://master.php.net/note/delete/86150/bad+code Del: spam -- https://master.php.net/note/delete/86150/spam Del: non-english -- https://master.php.net/note/delete/86150/non-english Del: in docs -- https://master.php.net/note/delete/86150/in+docs Del: other reasons-- https://master.php.net/note/delete/86150 Reject -- https://master.php.net/note/reject/86150 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#145078) next »