RE: regex expression to determine if i have a valid email!!

2005-09-16 Thread Ahlsen-Girard Edward F Contr MPSG
Title: RE: regex expression to determine if i have a valid email!!





 There is also the address checking _expression_ in the very nice Mail-Sendmail module.


-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] On Behalf Of [EMAIL PROTECTED]

Sent: Friday, September 16, 2005 14:05
To: perl-win32-users@listserv.ActiveState.com
Subject: Perl-Win32-Users Digest, Vol 20, Issue 14


Send Perl-Win32-Users mailing list submissions to
    perl-win32-users@listserv.ActiveState.com


To subscribe or unsubscribe via the World Wide Web, visit
    http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users
or, via email, send a message with subject or body 'help' to
    [EMAIL PROTECTED]


You can reach the person managing the list at
    [EMAIL PROTECTED]


When replying, please edit your Subject line so it is more specific
than "Re: Contents of Perl-Win32-Users digest..."



___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: regex expression to determine if i have a valid email!!

2005-09-16 Thread Thomas, Mark - BLS CTR
Sure. For extra coolness, you could do this via Ajax so that it is validated
on the fly while the user is still filling out the form. 

- Mark.

> -Original Message-
> From: bruce [mailto:[EMAIL PROTECTED] 
> Sent: Friday, September 16, 2005 11:21 AM
> To: Thomas, Mark - BLS CTR; 'perl-win32-users'
> Subject: RE: regex expression to determine if i have a valid email!!
> 
> so mark...
> 
> what you're saying is that i should write a simple perl app 
> that does the
> email validation, and call it from the php app, passing it 
> the email address
> to check
> 
> -bruce
> 
> 
> 
> -Original Message-
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] Behalf Of
> Thomas, Mark - BLS CTR
> Sent: Friday, September 16, 2005 5:49 AM
> To: '[EMAIL PROTECTED]'; 'perl-win32-users'
> Subject: RE: regex expression to determine if i have a valid email!!
> 
> 
> > i've got a php app
> 
> Say it isn't so! :)
> 
> > i finally figured that someone here, might have the exact
> > soln to my prob!
> 
> 1. Make sure it is formatted correctly, as per RFC 822. To do 
> that, there is
> one big scary regex created by Jeffrey Friedl (author of 
> Mastering Regular
> Expressions). If you check the link that $Bill gave you to 
> Email::Valid, the
> regular expression is in there.
> 
> 2. Make sure the domain is valid, and resolves to an IP address
> 
> 3. Make sure an MX record is defined for the domain, and the 
> mail host is
> accessible.
> 
> 4. (Optional) Check the ip against selected blacklist(s).
> 
> Of course, the easiest way to do this is Perl. Email::Valid 
> does 1-3 for
> you.
> 
> - Mark.
> 
> ___
> Perl-Win32-Users mailing list
> Perl-Win32-Users@listserv.ActiveState.com
> To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
> 
> 

___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: regex expression to determine if i have a valid email!!

2005-09-16 Thread bruce
so mark...

what you're saying is that i should write a simple perl app that does the
email validation, and call it from the php app, passing it the email address
to check

-bruce



-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of
Thomas, Mark - BLS CTR
Sent: Friday, September 16, 2005 5:49 AM
To: '[EMAIL PROTECTED]'; 'perl-win32-users'
Subject: RE: regex expression to determine if i have a valid email!!


> i've got a php app

Say it isn't so! :)

> i finally figured that someone here, might have the exact
> soln to my prob!

1. Make sure it is formatted correctly, as per RFC 822. To do that, there is
one big scary regex created by Jeffrey Friedl (author of Mastering Regular
Expressions). If you check the link that $Bill gave you to Email::Valid, the
regular expression is in there.

2. Make sure the domain is valid, and resolves to an IP address

3. Make sure an MX record is defined for the domain, and the mail host is
accessible.

4. (Optional) Check the ip against selected blacklist(s).

Of course, the easiest way to do this is Perl. Email::Valid does 1-3 for
you.

- Mark.

___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: regex expression to determine if i have a valid email!!

2005-09-16 Thread pDale
On 9/16/05, Chris Wagner <[EMAIL PROTECTED]> wrote:
Well it very much depends on what u consider a "valid" email address.Because technically, anything can be valid in some context.  What u probablywant here is a fully qualified Internet mail address.  The basic form of
this would be m/[EMAIL PROTECTED]/.  If u want to limit that to known"legitimate" MX's u can do DNS lookups on the domain part.At 08:23 PM 9/15/05 -0700, [EMAIL PROTECTED]
 wrote:>hi...>>i've got a php app, and i'm trying to figure out how/where to turn to to get>a good working regex in order to determine if i have a valid email address>>any help/thoughts/etc.. would be seriously helpful...
>>i've come across a great many preg_match functions for php, but i haven't>run across one that works all the time!!
Here's an article that discusses true validation: 

-- 
pDale
"Quando Omni Flunkus Moritati."
  (When all else fails, play dead.)
   -- Red Green
___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: regex expression to determine if i have a valid email!!

2005-09-16 Thread Thomas, Mark - BLS CTR
> i've got a php app

Say it isn't so! :)

> i finally figured that someone here, might have the exact 
> soln to my prob!

1. Make sure it is formatted correctly, as per RFC 822. To do that, there is
one big scary regex created by Jeffrey Friedl (author of Mastering Regular
Expressions). If you check the link that $Bill gave you to Email::Valid, the
regular expression is in there.

2. Make sure the domain is valid, and resolves to an IP address

3. Make sure an MX record is defined for the domain, and the mail host is
accessible.

4. (Optional) Check the ip against selected blacklist(s).

Of course, the easiest way to do this is Perl. Email::Valid does 1-3 for
you.

- Mark.

___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: regex expression to determine if i have a valid email!!

2005-09-16 Thread $Bill Luebkert
Chris Wagner wrote:

> Well it very much depends on what u consider a "valid" email address.
> Because technically, anything can be valid in some context.  What u probably
> want here is a fully qualified Internet mail address.  The basic form of
> this would be m/[EMAIL PROTECTED]/.

The protocol expects a path like this to the mail server:

 ::= "<" [  ":" ]  ">"

The "mailbox" portion is what you would normally see at the app.
See  below:

 ::=  |  "," 

 ::= "@" 

 ::=   |  "." 

 ::=  | "#"  | "["  "]"

 ::=  "@" 

 ::=  | 

 ::=   

 ::=  |  

 ::=  | 

 ::=  |  | "-"

 ::=  |  "." 

 ::=  |  

 ::=  """  """

 ::=  "\"  | "\"   |  |  

 ::=  | "\" 

 ::=  "."  "."  "." 

 ::=  |  

 ::=  

 ::= the carriage return character (ASCII code 13)

 ::= the line feed character (ASCII code 10)

 ::= the space character (ASCII code 32)

 ::= one, two, or three digits representing a decimal
  integer value in the range 0 through 255

 ::= any one of the 52 alphabetic characters A through Z
  in upper case and a through z in lower case

 ::= any one of the 128 ASCII characters, but not any
   or 

 ::= any one of the ten digits 0 through 9

 ::= any one of the 128 ASCII characters except ,
  , quote ("), or backslash (\)

 ::= any one of the 128 ASCII characters (no exceptions)

 ::= "<" | ">" | "(" | ")" | "[" | "]" | "\" | "."
  | "," | ";" | ":" | "@"  """ | the control
  characters (ASCII codes 0 through 31 inclusive and
  127)

>  If u want to limit that to known
> "legitimate" MX's u can do DNS lookups on the domain part.


-- 
  ,-/-  __  _  _ $Bill LuebkertMailto:[EMAIL PROTECTED]
 (_/   /  )// //   DBE CollectiblesMailto:[EMAIL PROTECTED]
  / ) /--<  o // //  Castle of Medieval Myth & Magic http://www.todbe.com/
-/-' /___/_<_http://dbecoll.tripod.com/ (My Perl/Lakers stuff)
___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: regex expression to determine if i have a valid email!!

2005-09-15 Thread $Bill Luebkert
bruce wrote:
> hi...
> 
> i've got a php app, and i'm trying to figure out how/where to turn to to get
> a good working regex in order to determine if i have a valid email address
> 
> any help/thoughts/etc.. would be seriously helpful...
> 
> i've come across a great many preg_match functions for php, but i haven't
> run across one that works all the time!!
> 
> i finally figured that someone here, might have the exact soln to my prob!

Try these links for help:

http://search.cpan.org/src/MAURICE/Email-Valid-0.15/Valid.pm
http://www.perl.com/CPAN/authors/Tom_Christiansen/scripts/ckaddr.gz

-- 
  ,-/-  __  _  _ $Bill LuebkertMailto:[EMAIL PROTECTED]
 (_/   /  )// //   DBE CollectiblesMailto:[EMAIL PROTECTED]
  / ) /--<  o // //  Castle of Medieval Myth & Magic http://www.todbe.com/
-/-' /___/_<_http://dbecoll.tripod.com/ (My Perl/Lakers stuff)
___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Re: regex expression to determine if i have a valid email!!

2005-09-15 Thread Chris Wagner
Well it very much depends on what u consider a "valid" email address.
Because technically, anything can be valid in some context.  What u probably
want here is a fully qualified Internet mail address.  The basic form of
this would be m/[EMAIL PROTECTED]/.  If u want to limit that to known
"legitimate" MX's u can do DNS lookups on the domain part.

At 08:23 PM 9/15/05 -0700, [EMAIL PROTECTED] wrote:
>hi...
>
>i've got a php app, and i'm trying to figure out how/where to turn to to get
>a good working regex in order to determine if i have a valid email address
>
>any help/thoughts/etc.. would be seriously helpful...
>
>i've come across a great many preg_match functions for php, but i haven't
>run across one that works all the time!!
>
>i finally figured that someone here, might have the exact soln to my prob!







--
REMEMBER THE WORLD TRADE CENTER ---=< WTC 911 >=--
"...ne cede malis"

0100

___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


RE: regex expression to determine if i have a valid email!!

2005-09-15 Thread Charles K. Clarkson
bruce <> wrote:

: i've got a php app, and i'm trying to figure out how/where to
: turn to to get a good working regex in order to determine if i
: have a valid email address 
: 
: any help/thoughts/etc.. would be seriously helpful...
: 
: i've come across a great many preg_match functions for php, but
: i haven't run across one that works all the time!!

I think this works if you remove comments from the address
first. Email will probably screw it up. Search google for it.

(?:(?:\r\n)?[ \t])*(?:(?:(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[
\t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[
\t]))*"(?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\]
\000-\031]+(?:(?:(?:\r\n)?[
\t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[
\t]))*"(?:(?:\r\n)?[ \t])*))*@(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\]
\000-\031]+(?:(?:(?:\r\n)?[
\t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[
\t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\]
\000-\031]+(?:(?:(?:\r\n)?[
\t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[
\t])*))*|(?:[^()<>@,;:\\".\[\] \000-\031]+(?:(?:(?:\r\n)?[
\t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[
\t]))*"(?:(?:\r\n)?[ \t])*)*\<(?:(?:\r\n)?[ \t])*(?:@(?:[^()<>@,;:\\".\[\]
\000-\031]+(?:(?:(?:\r\n)?[
\t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[
\t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\]
\000-\031]+(?:(?:(?:\r\n)?[
\t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[
\t])*))*(?:,@(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\]
\000-\031]+(?:(?:(?:\r\n)?[
\t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[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t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\]
\000-\031]+(?:(?:(?:\r\n)?[
\t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[
\t])*))*)*:(?:(?:\r\n)?[ \t])*)?(?:[^()<>@,;:\\".\[\]
\000-\031]+(?:(?:(?:\r\n)?[
\t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[
\t]))*"(?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\]
\000-\031]+(?:(?:(?:\r\n)?[
\t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[
\t]))*"(?:(?:\r\n)?[ \t])*))*@(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\]
\000-\031]+(?:(?:(?:\r\n)?[
\t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[
\t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\]
\000-\031]+(?:(?:(?:\r\n)?[
\t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|\[([^\[\]\r\\]|\\.)*\](?:(?:\r\n)?[
\t])*))*\>(?:(?:\r\n)?[ \t])*)(?:,\s*(?:(?:[^()<>@,;:\\".\[\]
\000-\031]+(?:(?:(?:\r\n)?[
\t])+|\Z|(?=[\["()<>@,;:\\".\[\]]))|"(?:[^\"\r\\]|\\.|(?:(?:\r\n)?[
\t]))*"(?:(?:\r\n)?[ \t])*)(?:\.(?:(?:\r\n)?[ \t])*(?:[^()<>@,;:\\".\[\]
\000-\031]+(?:(?:(?:\r\n)?[
\t])

regex expression to determine if i have a valid email!!

2005-09-15 Thread bruce
hi...

i've got a php app, and i'm trying to figure out how/where to turn to to get
a good working regex in order to determine if i have a valid email address

any help/thoughts/etc.. would be seriously helpful...

i've come across a great many preg_match functions for php, but i haven't
run across one that works all the time!!

i finally figured that someone here, might have the exact soln to my prob!


thanks

-bruce
[EMAIL PROTECTED]


___
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs