note 87352 added to function.preg-match
| From: | rbotzer at yahoo dot com | Date: | Mon, 01 Dec 2008 19:36:41 +0000 |
| Subject: | note 87352 added to function.preg-match | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-147492@lists.php.net to get a copy of this message | ||
@Ben:
Your pattern will match 1.1.255.299 (it matches the .29 at the end out of subpattern .299)
This pattern eliminates such false positives:
/^((1?\d{1,2}|2[0-4]\d|25[0-5])\.){3}(1?\d{1,2}|2[0-4]\d|25[0-5]){1}$/
Ronen
----
Server IP: 69.147.83.197
Probable Submitter: 76.247.110.138
----
Manual Page -- http://www.php.net/manual/en/function.preg-match.php
Edit -- https://master.php.net/note/edit/87352
Del: integrated -- https://master.php.net/note/delete/87352/integrated
Del: useless -- https://master.php.net/note/delete/87352/useless
Del: bad code -- https://master.php.net/note/delete/87352/bad+code
Del: spam -- https://master.php.net/note/delete/87352/spam
Del: non-english -- https://master.php.net/note/delete/87352/non-english
Del: in docs -- https://master.php.net/note/delete/87352/in+docs
Del: other reasons-- https://master.php.net/note/delete/87352
Reject -- https://master.php.net/note/reject/87352
Search -- https://master.php.net/manage/user-notes.php