Gerard Samuel wrote:
What Im trying to do is, reject all email address strings ending in yahoo.com, except [EMAIL PROTECTED]
Im trying ->
<?php

if (preg_match('/[^[EMAIL PROTECTED]|yahoo.com]$/', '[EMAIL PROTECTED]'))
{
echo 'match found';
}
else
{
echo 'match not found';
}

?>

The search pattern must also be capable of expanding to something like ->
^[EMAIL PROTECTED]|yahoo.com|^foo@hotmail|hotmail.com
Basically what Im trying to perform is to reject all email address strings ending in either yahoo.com or hotmail.com,
except strings ending in [EMAIL PROTECTED] or [EMAIL PROTECTED]

Thanks for any insight you may provide...

this is pretty close

<?php
echo (preg_match('/(?<!08701)@yahoo\.com$/', '[EMAIL PROTECTED]') ? 'match found' : 'match not found');
echo "\n";
?>

look at the manual about assertions
http://www.php.net/manual/en/pcre.pattern.syntax.php

--

Sean


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to