FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » What this means "(\w|-)+@\w"?
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: What this means "(\w|-)+@\w"? [message #174787 is a reply to message #174786] Thu, 07 July 2011 19:12 Go to previous messageGo to previous message
Michael Fesser is currently offline  Michael Fesser
Messages: 215
Registered: September 2010
Karma:
Senior Member
.oO(Eli the Bearded)

> In comp.lang.php, zhang yun <bigzhangyun(at)gmail(dot)com> wrote:
>> Hi,there
>> I have some problems in regular expression, here is code :
>> function is_email($e_name)
>> {
>
> That's a poorly named function. Lots and lots of valid email
> addresses will be rejected by this crappy code.
>
>> $arr = array("ac","com","net","org","edu","gov","mil","ac\.cn",
>> "com\.cn","edu\.cn","net\.cn","org\.cn");
>
> Have you heard about the new top level domains (TLDs)? .info is new as
> of, oh, about year 2000. There are some others, too. And other country
> codes.

ACK. And a lot more TLDs with arbitrary length are about to come.

In fact checking an email address with regular expressions is almost
impossible. It would make more sense to just perform a rough check like
..+@.+ and then just take it as-is. If it's valid, the email will be
sent. If not, it will bounce, but who really cares?

Micha
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: upgrade of php & split deprecated = HELP
Next Topic: Re: What is Islam?
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Fri Nov 29 21:07:40 GMT 2024

Total time taken to generate the page: 0.04796 seconds