note 87352 deleted from function.preg-match by danbrown
| From: | danbrown@php.net | Date: | Wed, 03 Aug 2011 13:11:30 +0000 |
| Subject: | note 87352 deleted from function.preg-match by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-182149@lists.php.net to get a copy of this message | ||
Note Submitter: rbotzer at yahoo dot com
----
@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