Regex for email validation

This is a discussion on Regex for email validation within the PHP forums in Programming Languages category; Honestly, I'd stick to using php's filter extension. It -should- be the best one out there. If it is not processing something it should, then it's a bug - submit it so all of us benefit I am tired of trying to find regexps and all that every time, I put my stock into PHP's core when I can. On 8/27/08, Lupus Michaelis <mickael+php @ lupusmic.org> wrote: > mike a écrit : > > > > php should have a good check built-in. > > > > see http://www.php.net/manual/en/function.filter-var.php > > > > Argh ! Howmany times it is in ...

Go Back   Application Development Forum > Programming Languages > PHP

Object Mix

Register FAQ Calendar Search Today's Posts Mark Forums Read
  #21  
Old 08-27-2008, 07:25 PM
mike
Guest
 
Default Re: [PHP] Regex for email validation

Honestly, I'd stick to using php's filter extension.

It -should- be the best one out there. If it is not processing
something it should, then it's a bug - submit it so all of us benefit


I am tired of trying to find regexps and all that every time, I put my
stock into PHP's core when I can.

On 8/27/08, Lupus Michaelis <mickael+php@lupusmic.org> wrote:
> mike a écrit :
> >
> > php should have a good check built-in.
> >
> > see http://www.php.net/manual/en/function.filter-var.php
> >

>
> Argh ! Howmany times it is in ? I spent so many time to write a regex that
> belongs the RFC822 :-/ Because all the regex in answer here was false. They
> don't allow email like "Mickael Doodoo"@lupusmic.com nor
> mickael+doudou@lupusmic.org ; and they are valuable email addresses. Without
> the fact that a top level domain isn't always between two and three
> characters (think about .museum).
>
> --
> Mickaël Wolff aka Lupus Michaelis
> http://lupusmic.org
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

Reply With Quote
  #22  
Old 08-28-2008, 03:22 AM
Per Jessen
Guest
 
Default Re: [PHP] Regex for email validation

tedd wrote:

> The WG did solve this issue and came up with a way to do that -- the
> current algorithm is called PUNYCODE which allows Unicode code-points
> to appear in a domain name. I know this to be true because I have
> several domains that lie outside the standard ASCII AND they are real
> domains that have real web sites.


That was never in dispute, Tedd - IDNs are well known, certainly around
here.

> If you have a browser (like Safari) that is capable of showing the
> URL in it's native charset, then you will see the Rx.com in the url.
> If not, then you'll see xn--u2g.com.


I think most browsers will work with IDNs today, possibly with the
exception of MSIE (?)

> Now, email can be sent from that domain, but I have not found an
> application that will send nor receive it. The software has simply
> not caught up with the technology.


Which is weird, to say the least.


/Per Jessen, Zürich

Reply With Quote
  #23  
Old 08-28-2008, 03:28 AM
Per Jessen
Guest
 
Default Re: [PHP] Regex for email validation

Kevin Waterson wrote:

> There is no silver bullet regex to validate all RFC compliant email
> address. Many have tried, but they all fail at some point. The best
> you can do is cater to most _sane_ addresses.
>


Exactly - the regex is a quick/cheap sanity check, nothing more. To go
all the way, you could try doing an SMTP VRFY against the MX for the
domain, but it's really taking it a bit too far.


/Per Jessen, Zürich

Reply With Quote
  #24  
Old 08-28-2008, 03:29 AM
Yeti
Guest
 
Default Re: [PHP] Regex for email validation

That Rx.com domain name is really great stuff, but how do you expect
the average user to type it in?
Reply With Quote
  #25  
Old 08-28-2008, 03:34 AM
Per Jessen
Guest
 
Default Re: [PHP] Regex for email validation

Yeti wrote:

> That Rx.com domain name is really great stuff, but how do you expect
> the average user to type it in?
>


Sorry, I don't understand the problem. The average user will obviously
have a suitable keyboard, such as this for instance:

http://en.wikipedia.org/wiki/Image:KB_Swiss.svg


/Per Jessen, Zürich

Reply With Quote
  #26  
Old 08-28-2008, 03:44 PM
tedd
Guest
 
Default Re: [PHP] Regex for email validation

At 9:29 AM +0200 8/28/08, Yeti wrote:
>That Rx.com domain name is really great stuff, but how do you expect
>the average user to type it in?



Of course the problem has always been how can the user enter these
types of characters from their keyboard. But, that's pretty simply
with a Mac and as the rest of the world continues to log-on to the
Internet (in record numbers in their own languages) I am sure that
the problem of how to type in non-ASCII characters will become more
of an issue and the solution will solve my problem as well.

But as it is now, it's not so much IF the domain name is easy to
type in or not, but rather does the Rx.com show up in the URL once
you get there? And it does for most browsers other than IE.

You can get to the site very easily, try typing:

http://rx-2.com

That wasn't hard, now was it?

The same could be done for: http://www.jnj.com or any other
Pharmaceutical Company -- or at least that's what I'm selling.

Now, will some bright young savvy pharmaceutical executive recognize
the opportunity or will this idea continue to float around until it
becomes obvious to the brain-dead -- your guess is as good as mine.
But, the day is coming. I just hope that I don't have to will my
symbol domains to my son or grandson to finally have them pay off. :-)

Cheers,

tedd

--
-------
http://sperling.com http://ancientstones.com http://earthstones.com
Reply With Quote
  #27  
Old 08-28-2008, 03:56 PM
tedd
Guest
 
Default Re: [PHP] Regex for email validation

At 9:34 AM +0200 8/28/08, Per Jessen wrote:
>Yeti wrote:
>
>> That Rx.com domain name is really great stuff, but how do you expect
>> the average user to type it in?
>>

>
>Sorry, I don't understand the problem. The average user will obviously
>have a suitable keyboard, such as this for instance:
>
>http://en.wikipedia.org/wiki/Image:KB_Swiss.svg
>
>/Per Jessen, Zürich



I hope you're right.

However, it's one thing to have a keyboard
designed for a specific language and another to
be able to enter code-points that aren't
associated with any specific language (i.e.,
Dingbats and Math Symbols).

For example, note that Rx,com is not associated
with any language, which is the same as many of
my other domains, as you can see some here:

http://symboldomains.com/symbol-domains-for-sale.html

I bought most of these eight years ago hoping
that someone would see things the way I do. But
despite all my time, effort, and cost -- the only
thing I have received is being called a goofy
nitwit -- which I probably am -- but I would like
to think of myself as an entertaining nitwit. :-)

I have grandiose plans, but unfortunately I'm the only one who see's them.

Cheers,

tedd

--
-------
http://sperling.com http://ancientstones.com http://earthstones.com
Reply With Quote
  #28  
Old 08-30-2008, 07:20 AM
Per Jessen
Guest
 
Default Re: [PHP] Regex for email validation

tedd wrote:

> However, it's one thing to have a keyboard designed for a specific
> language and another to be able to enter code-points that aren't
> associated with any specific language (i.e., Dingbats and Math
> Symbols).


Ah yes, that's true. How about an APL2 keyboard then? :-)

> For example, note that Rx,com is not associated
> with any language, which is the same as many of
> my other domains, as you can see some here:
>
> http://symboldomains.com/symbol-domains-for-sale.html


Of course, some of those are closely associated with the greek
language/alphabet, but I take your point.

I think the problem is mostly on the domain owner side though - if you
register a domain for publishing something or other, but most of your
intended audience cannot enter it in an easy, straight-forward way,
you've only shot yourself in the foot, haven't you?


/Per Jessen, Zürich

Reply With Quote
  #29  
Old 08-30-2008, 07:23 AM
Per Jessen
Guest
 
Default Re: [PHP] Regex for email validation

tedd wrote:

> But as it is now, it's not so much IF the domain name is easy to
> type in or not, but rather does the Rx.com show up in the URL once
> you get there? And it does for most browsers other than IE.
>
> You can get to the site very easily, try typing:
>
> http://rx-2.com
>
> That wasn't hard, now was it?


What should have happened here, Tedd? I just got the message "you have
the wrong Browser" - I'm using Firefox, I thought that was perfectly
capable of using IDNs.


/Per Jessen, Zürich

Reply With Quote
  #30  
Old 08-30-2008, 07:30 AM
Per Jessen
Guest
 
Default Re: What's with the Rx symbol? (was: Regex for email validation)

Yeti wrote:

> That Rx.com domain name is really great stuff, but how do you expect
> the average user to type it in?
>


Completely separate question - I finally managed to get to Tedds site,
where I read this:

"The ℞symbol is a truly global icon for Pharmaceuticals. What
Pharmaceutical company would not want to own ℞.com -- if they are
seriously considering Global sales? While languages change throughout
the globe, the ℞ icon remains a constant and highly recognizable symbol
for Pharmaceuticals."

Now, I haven't worked in pharmaceuticals, but I've worked in most
European countries. So it's probably just me, but I've _never_ come
across the Rx symbol before. I don't think it's as global as you
think.


/Per Jessen, Zürich

Reply With Quote
Reply


Thread Tools
Display Modes


All times are GMT -5. The time now is 04:35 AM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
vB Ad Management by =RedTyger=

In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.