|
Posted by AnrDaemon on 10/24/07 22:58
Greetings, Steve.
In reply to Your message dated Wednesday, October 24, 2007, 21:34:41,
>>>> <?php
>>>>
>>>> $s = 'celo@tum.com, "mnp test" <celo@tum.com>,"test testt"
>>>> <otur@par.com>,
>>>> sett@tttt.com,test@twest.com';
>>>>
>>>> if(preg_match_all('#(?:^|[\s\,])<?([0-9A-Za-z\_]+(?:[\-\.][0-9A-Za-z\_]+)*\@[0-9A-Za-z]+(?:[\.\-\_][0-9A-Za-z]+)+)>?#xi',
>>>> $s, $ta))
>>>> {
>>>> var_export($ta[1]);
>>>> }
>>
>> S> of course you would. however, notice that whatever your prowess at
>> regex,
>> S> you lack understanding of the basic email conventions explained in the
>> S> rfc(s). your preg doesn't allow for atomic account names. ;^)
>>
>> Example please?
S> read the freaking email rfc(s).
Do it for me, please.
>> What You mean "atomic account names"?
S> hmmmm, what do you think?
S> the rfc's allow for 'illegal' characters in account names as long as they're
S> encapsulated. this is to compensate for non-latin character sets
S> (particularly, non-english sets). is that ringing a bell?
Never saw any in 10 years. And I think I'll never see.
Not all what allowed by RFC is acceptable by real ISP's.
Typical rules I see around the world:
(?i)^[a-z][0-9a-z]*(?:[\.\-\_][0-9a-z]+)*$
--
Sincerely Yours, AnrDaemon <anrdaemon@freemail.ru>
[Back to original message]
|