note 37843 deleted from function.preg-match by didou
| From: | didou@php.net | Date: | Sun, 23 May 2004 14:12:31 +0000 |
| Subject: | note 37843 deleted from function.preg-match by didou | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-69990@lists.php.net to get a copy of this message | ||
Note Submitter: Albie@AveIT.org
----
Just a simple correction to mkr@binarywerks post,
using this:
<?php
$num="([0-9]|1?\d\d|2[0-4]\d|25[0-5])";
?>
would not match any two digit number, matches, 0-9 or 100-199 or 200-249 250-255
Leaving out 10-99, easily corrected with this:
<?php
$num="([0-9]{1,2}|1?\d\d|2[0-4]\d|25[0-5])";
?>
Adding the 1,2 means it can be 1 or 2 digits in lenght.
--
Andy Calderbank