Date: 12/20/99
- Next message: php: "[PHP-DEV] Need Help For MySQL/PHP"
- Previous message: Shane Owenby: "Re: [PHP-DEV] cvs: /php3 configure.in"
- In reply to: Evan Klinger: "Re: [PHP-DEV] Bug #3014: octal character versus regex backreferences"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Hi, all. I'll be on the dev list, soon.
Consider this code, under 4.0b3:
#! php -q
<?php
$address = "AB:BC:CD:DE:EF:AF";
if (preg_match("/^[A-F]{2}([-:;,]?)([A-F]{2}\\1){4}[A-F]{2}$/", $address)) {
printf("preg_match matches '%s'\n", $address);
} else {
printf("preg_match !matches '%s'\n", $address);
}
if ( ereg("^[A-F]{2}([-:;,]?)([A-F]{2}\\1){4}[A-F]{2}$", $address)) {
printf("ereg matches '%s'\n", $address);
} else {
printf("ereg !matches '%s'\n", $address);
}
?>
output:
> preg_match matches 'AB:BC:CD:DE:EF:AF'
> ereg !matches 'AB:BC:CD:DE:EF:AF'
- chad
-- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: php-dev-unsubscribe <email protected> For additional commands, e-mail: php-dev-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>
- Next message: php: "[PHP-DEV] Need Help For MySQL/PHP"
- Previous message: Shane Owenby: "Re: [PHP-DEV] cvs: /php3 configure.in"
- In reply to: Evan Klinger: "Re: [PHP-DEV] Bug #3014: octal character versus regex backreferences"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

