help on regex
| From: | andy | Date: | Fri, 04 Oct 2002 11:53:25 +0000 |
| Subject: | help on regex | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-118862@lists.php.net to get a copy of this message | ||
Hi everybody,
I am trying to learn regex and could need some help.
There are 2 function I would need. 1 which returns false if the data does
contain anything else than numbers or fullstops
I tryed this:
function validate_phone ($phone) {
return (ereg('^[0-9][:punct:]', $phone));
}
The next one is to return fals if the data does not contain a number inside
the string ("street 893" would be valid)
I tryed this:
function validate_street ($street) {
return (ereg('^[0-9]', $street));
}
Unfortunatelly this does not work like I want ;-)
Thank you for any help on this,
andy