Re: [PHP] Regex for email validation

2008-08-30 Thread Per Jessen
Per Jessen wrote: > 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: >> >

Re: [PHP] Regex for email validation

2008-08-30 Thread Per Jessen
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 wa

Re: [PHP] Regex for email validation

2008-08-30 Thread Per Jessen
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 examp

Re: [PHP] Regex for email validation

2008-08-28 Thread tedd
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://

Re: [PHP] Regex for email validation

2008-08-28 Thread tedd
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 t

Re: [PHP] Regex for email validation

2008-08-28 Thread Per Jessen
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 /

Re: [PHP] Regex for email validation

2008-08-28 Thread Yeti
That Rx.com domain name is really great stuff, but how do you expect the average user to type it in? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Regex for email validation

2008-08-28 Thread Per Jessen
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,

Re: [PHP] Regex for email validation

2008-08-28 Thread Per Jessen
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 > d

Re: [PHP] Regex for email validation

2008-08-27 Thread mike
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

Re: [PHP] Regex for email validation

2008-08-27 Thread Kevin Waterson
This one time, at band camp, Yeti <[EMAIL PROTECTED]> wrote: > # this one worked fine for me, but it does not cover the full RFC > like: "name" [EMAIL PROTECTED] OR name <[EMAIL PROTECTED]> > $regex = > "^[a-z0-9,!#\$%&'\*\+/=\?\^_`\{\|}~-]+(\.[a-z0-9,!#\$%&'\*\+/=\?\^_`\{\|}~-]+)[EMAIL > PROTE

Re: [PHP] Regex for email validation

2008-08-27 Thread tedd
At 8:35 PM +0200 8/27/08, Per Jessen wrote: > So, regardless of the documentation, which may be outdated, I know > that Unicode characters can be used in IDNS and thus on both sides of the @, You're wrong - IDNs only apply to the right side of the @. (check out what the 'D' means). The D

Re: [PHP] Regex for email validation

2008-08-27 Thread tedd
At 8:35 PM +0200 8/27/08, Per Jessen wrote: Go on, send me that email to '[EMAIL PROTECTED]' ... for what it's worth, I can't even define an account like that, so my mailserver might well reject it. Yes, you are right. I was thinking of something else, namely that the LHS of the email address

Re: [PHP] Regex for email validation

2008-08-27 Thread Lupus Michaelis
Per Jessen a écrit : I don't know, but I suspect due to lack of support in popular mailers and mail-servers. Also, the use of quotes does make it cumbersome to work with, both as a user and as a mailserver admin. I had to write some pieace of code that can handle "toto toto"@ndd five year

Re: [PHP] Regex for email validation

2008-08-27 Thread Per Jessen
Lupus Michaelis wrote: > Per Jessen a écrit : > >> That format is about as dead as the dinosaurs. > >Why ? I don't know, but I suspect due to lack of support in popular mailers and mail-servers. Also, the use of quotes does make it cumbersome to work with, both as a user and as a mailserve

Re: [PHP] Regex for email validation

2008-08-27 Thread Lupus Michaelis
Per Jessen a écrit : That format is about as dead as the dinosaurs. Why ? -- 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

Re: [PHP] Regex for email validation

2008-08-27 Thread Per Jessen
tedd wrote: > >>No, they can't. There are no 8-bit characters allowed in an >>email-address. Check out RFC2821. > > You can throw all the facts and documentation you want at me, but the > left side of the @ has always been open to anything you want. Except anything 8-bit, yes. Seriously, r

Re: [PHP] Regex for email validation

2008-08-27 Thread tedd
At 7:55 PM +0200 8/27/08, Lupus Michaelis 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 answe

Re: [PHP] Regex for email validation

2008-08-27 Thread tedd
At 6:30 PM +0200 8/27/08, Per Jessen wrote: Well, I left that for the OP to figure out. Still, your regex is worse - a domain name cannot contain '%'. The only valid characters for a domain name are letters, numbers and a hyphen. Also, maximum length for a domain name is 64 characters, which c

Re: [PHP] Regex for email validation

2008-08-27 Thread Per Jessen
Lupus Michaelis wrote: >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 That format is about as dead as the dinosaurs. I kn

Re: [PHP] Regex for email validation

2008-08-27 Thread Lupus Michaelis
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 "Mic

Re: [PHP] Regex for email validation

2008-08-27 Thread Per Jessen
Yeti wrote: > # this one worked fine for me, but it does not cover the full RFC > like: "name" [EMAIL PROTECTED] OR name <[EMAIL PROTECTED]> > $regex = > "^[a-z0-9,!#\$%&'\*\+/=\?\^_`\{\|}~-]+(\.[a-z0-9,!#\$%&'\*\+/=\ \^_`\{\|}~-]+)[EMAIL PROTECTED](\.[a-z0-9-]+)*\.([a-z]{2,})$"; For the domain

Re: [PHP] Regex for email validation

2008-08-27 Thread Per Jessen
tedd wrote: >> >>Option 1: /[EMAIL PROTECTED]/ >> >>This is probably what you meant: >> >>/[EMAIL PROTECTED]/ >> >>/Per Jessen, Zürich > > Which is probably what you meant: > > eregi("[EMAIL PROTECTED],6}$", $email) > > Email comes in different TLD flavors. Well, I left that for the OP to fi

Re: [PHP] Regex for email validation

2008-08-27 Thread Yeti
$regex = "^[a-z0-9,!#\$%&'\*\+/=\?\^_`\{\|}~-]+(\.[a-z0-9,!#\$%&'\*\+/=\?\^_`\{\|}~-]+)[EMAIL PROTECTED](\.[a-z0-9-]+)*\.([a-z]{2,})$"; if (eregi($regex, $email)) { // do something } # Beware that the filter functions only work under PHP5+. If your PHP supports them they should be the preferred

Re: [PHP] Regex for email validation

2008-08-27 Thread tedd
At 9:31 AM +0200 8/27/08, Per Jessen wrote: VamVan wrote: Hello Guys, Does any have a regex for email validation? I need to allow only period and underscore in the local part , we would need a @ and .com or watever for domain. Option 1: /[EMAIL PROTECTED]/ This is probably what you me

Re: [PHP] Regex for email validation

2008-08-27 Thread Richard Heyes
> Does any have a regex for email validation? I need to allow only period and > underscore in the local part , we would need a @ and .com or watever for > domain. You could: 1. Take the isValidInetAddress() method out of the PEAR Mail_RFC822 class and use that. 2. Use the filter extension which I

Re: [PHP] Regex for email validation

2008-08-27 Thread Micah Gersten
That's a very handy extension. Thank you, Micah Gersten onShore Networks Internal Developer http://www.onshore.com mike wrote: > > php should have a good check built-in. > > see http://www.php.net/manual/en/function.filter-var.php > > if(!filter_var($var, FILTER_VALIDATE_EMAIL)) { > echo "inv

Re: [PHP] Regex for email validation

2008-08-27 Thread Per Jessen
VamVan wrote: > Hello Guys, > > Does any have a regex for email validation? I need to allow only > period and underscore in the local part , we would need a @ and .com > or watever for domain. Option 1: /[EMAIL PROTECTED]/ This is probably what you meant: /[EMAIL PROTECTED]/ /Per Jessen, Z

Re: [PHP] Regex for email validation

2008-08-27 Thread mike
> On 8/27/08, VamVan <[EMAIL PROTECTED]> wrote: > Hello Guys, > > Does any have a regex for email validation? I need to allow only period and > underscore in the local part , we would need a @ and .com or watever for > domain. php should have a good check built-in. see http://www.php.net/manual/e

[PHP] Regex for email validation

2008-08-27 Thread VamVan
Hello Guys, Does any have a regex for email validation? I need to allow only period and underscore in the local part , we would need a @ and .com or watever for domain. thank you