Re: [GENERAL] Select all invalid e-mail addresses

2005-10-25 Thread Scott Marlowe
On Tue, 2005-10-25 at 13:01, Andrus wrote: > >> This regex allows email addresses containing two dots without any > >> letters, > >> like [EMAIL PROTECTED] > > > > That's because the regular expression is wrong: it simply checks > > the local part for zero or more non-@ characters instead of checki

Re: [GENERAL] Select all invalid e-mail addresses

2005-10-25 Thread Andrus
>> This regex allows email addresses containing two dots without any >> letters, >> like [EMAIL PROTECTED] > > That's because the regular expression is wrong: it simply checks > the local part for zero or more non-@ characters instead of checking > against the RFC822/RFC2822 specification. Use a s

Re: [GENERAL] Select all invalid e-mail addresses

2005-10-25 Thread Steve Atkins
On Tue, Oct 25, 2005 at 09:09:44AM -0600, Michael Fuhr wrote: > On Tue, Oct 25, 2005 at 11:20:53AM +0300, Andrus wrote: > > This regex allows email addresses containing two dots without any letters, > > like [EMAIL PROTECTED] > > I havent seen any email of such kind. > > That's because the regula

Re: [GENERAL] Select all invalid e-mail addresses

2005-10-25 Thread Michael Fuhr
On Tue, Oct 25, 2005 at 11:20:53AM +0300, Andrus wrote: > This regex allows email addresses containing two dots without any letters, > like [EMAIL PROTECTED] > I havent seen any email of such kind. That's because the regular expression is wrong: it simply checks the local part for zero or more no

Re: [GENERAL] Select all invalid e-mail addresses

2005-10-25 Thread Andrus
> Suggestions: use text or varchar for the email address, don't embed > newlines in the regular expression, and if you use dollar quotes > and the regular expression ends with a dollar sign then quote with > a character sequence other than $$. Michael, thank you. Excellent! I'm afraid that using

Re: [GENERAL] Select all invalid e-mail addresses

2005-10-24 Thread Michael Fuhr
On Mon, Oct 24, 2005 at 09:02:26PM +0300, Andrus wrote: > I applied Michael hint about dollar quoting to this and tried > > create temp table customer ( email char(60)); > insert into customer values( '[EMAIL PROTECTED]'); > SELECT email FROM customer WHERE email !~* > $$ > [EMAIL PROTECTED]@

Re: [GENERAL] Select all invalid e-mail addresses

2005-10-24 Thread Andrus
> SELECT email FROM customer > WHERE email !~* > '[EMAIL PROTECTED]@(?:[EMAIL > PROTECTED])?[a-z0-9_-]+\.(?:a[defgilmnoqrstuwz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvxyz]|d[ejkmoz]|e[ceghrst]|f[ijkmorx]|g[abdefhilmnpqrstuwy]|h[kmnrtu]|i[delnoqrst]|j[mop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acd

Re: [GENERAL] Select all invalid e-mail addresses

2005-10-21 Thread Michael Fuhr
On Fri, Oct 21, 2005 at 11:49:54AM -0700, Steve Atkins wrote: > SELECT email FROM customer >WHERE email !~* > '[EMAIL PROTECTED]@(?:[EMAIL > PROTECTED])?[a-z0-9_-]+\.(?:a[defgilmnoqrstuwz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvxyz]|d[ejkmoz]|e[ceghrst]|f[ijkmorx]|g[abdefhilmnpqrstuwy]|h

Re: [GENERAL] Select all invalid e-mail addresses

2005-10-21 Thread Michael Fuhr
On Fri, Oct 21, 2005 at 08:15:23PM +0300, Andrus wrote: > I tried > > SELECT email FROM customer > WHERE email !~ > '/[EMAIL PROTECTED]@(?:[EMAIL > PROTECTED])?[a-z0-9-_]+\.(?:a[defgilmnoqrstuwz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvxyz]|d[ejkmoz]|e[ceghrst]|f[ijkmorx]|g[abdefhilmnpqrstu

Re: [GENERAL] Select all invalid e-mail addresses

2005-10-21 Thread Steve Atkins
On Fri, Oct 21, 2005 at 08:15:23PM +0300, Andrus wrote: > >> How to write a WHERE clause which selects e-mail addresses which > >> are surely wrong ? > > > > ... WHERE email !~ '...insert previously mentioned regex here...'; > > Steve, > > thank you. > > I tried [snip] SELECT email FROM cu

Re: [GENERAL] Select all invalid e-mail addresses

2005-10-21 Thread Andrus
>> How to write a WHERE clause which selects e-mail addresses which >> are surely wrong ? > > ... WHERE email !~ '...insert previously mentioned regex here...'; Steve, thank you. I tried SELECT email FROM customer WHERE email !~ '/[EMAIL PROTECTED]@(?:[EMAIL PROTECTED])?[a-z0-9-_]+\.(?:

Re: [GENERAL] Select all invalid e-mail addresses

2005-10-20 Thread Andrew Sullivan
On Thu, Oct 20, 2005 at 12:34:39PM -0700, Steve Atkins wrote: > > While there are valid deliverable email addresses in .arpa, you really > don't want to be accepting them from end users... You know, as someone who has been bitten hundreds of times by the decision of some application designer who

Re: [GENERAL] Select all invalid e-mail addresses

2005-10-20 Thread Dann Corbit
:pgsql-general- > [EMAIL PROTECTED] On Behalf Of Steve Atkins > Sent: Thursday, October 20, 2005 12:35 PM > To: pgsql-general@postgresql.org > Subject: Re: [GENERAL] Select all invalid e-mail addresses > > On Thu, Oct 20, 2005 at 11:52:40AM -0400, Andrew Sullivan wrote: > >

Re: [GENERAL] Select all invalid e-mail addresses

2005-10-20 Thread Andrew Sullivan
On Thu, Oct 20, 2005 at 09:54:13PM +0300, Andrus wrote: > How to write a WHERE clause which selects e-mail addresses which > are surely wrong ? Then I think the validating function someone else sent here () is a good start. You probably want the o

Re: [GENERAL] Select all invalid e-mail addresses

2005-10-20 Thread Steve Atkins
On Thu, Oct 20, 2005 at 11:52:40AM -0400, Andrew Sullivan wrote: > On Thu, Oct 20, 2005 at 06:10:40PM +0300, Andrus wrote: > > >From this thread I got the regular expression > > [snipped] > > Note that that regular expression, which appears to be validating > TLDs as well, is incredibly fragile.

Re: [GENERAL] Select all invalid e-mail addresses

2005-10-20 Thread Steve Atkins
On Thu, Oct 20, 2005 at 09:54:13PM +0300, Andrus wrote: > "Andrew Sullivan" <[EMAIL PROTECTED]> wrote in message > > > I suggest that if you want to validate TLDs, you pull them off when > > you write the data in your database, and use a lookup table to make > > sure they're valid (you can keep th

Re: [GENERAL] Select all invalid e-mail addresses

2005-10-20 Thread Andrus
"Andrew Sullivan" <[EMAIL PROTECTED]> wrote in message > I suggest that if you want to validate TLDs, you pull them off when > you write the data in your database, and use a lookup table to make > sure they're valid (you can keep the table up to date regularly by > checking the official IANA regi

Re: [GENERAL] Select all invalid e-mail addresses

2005-10-20 Thread Andrew Sullivan
On Thu, Oct 20, 2005 at 11:22:25AM -0400, Brian Mathis wrote: > That's why I think the better term for this is "well formed". "Validity" can > only be determined by sending to it, but you can tell if an address at least In fact, it can only be determined by sending to it over and over again, beca

Re: [GENERAL] Select all invalid e-mail addresses

2005-10-20 Thread Andrew Sullivan
On Thu, Oct 20, 2005 at 06:10:40PM +0300, Andrus wrote: > >From this thread I got the regular expression [snipped] Note that that regular expression, which appears to be validating TLDs as well, is incredibly fragile. John Klensin has actually written an RFC about this very problem. Among other

Re: [GENERAL] Select all invalid e-mail addresses

2005-10-20 Thread Brian Mathis
On 10/20/05, Douglas McNaught <[EMAIL PROTECTED]> wrote: > It performs a MX-lookup, which IMHO is the best way to check for validity.But that's expensive and slow, and doesn't tell you whether the userpart of the address is valid (and in general, there's no way to determine that short of actually s

Re: [GENERAL] Select all invalid e-mail addresses

2005-10-20 Thread Andrus
""Guy Rouillier"" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Andrus wrote: >> I have a database of e-mail addresses. >> >> I want to select the email addresses which are not valid: >> >> do not contain exactly one @ character, >> contain ; > < " ' , characters or spaces etc. >>

Re: [GENERAL] Select all invalid e-mail addresses

2005-10-20 Thread Hannes Dorbath
On 20.10.2005 14:00, Douglas McNaught wrote: But that's expensive and slow Sure, that isn't meant to be used in a WHERE condition on a 100k row table.. more to be bound via check constraint on a user table, so incomming data is validated. and doesn't tell you whether the user part of the a

Re: [GENERAL] Select all invalid e-mail addresses

2005-10-20 Thread Douglas McNaught
Hannes Dorbath <[EMAIL PROTECTED]> writes: > On 19.10.2005 21:18, Michael Fuhr wrote: >> One possibility would be to write a plperlu function that uses the >> Email::Valid module. Here's a trivial example; see the Email::Valid >> documentation to learn about its full capabilities: > > ..and if yo

Re: [GENERAL] Select all invalid e-mail addresses

2005-10-20 Thread Edmund
"Andrus" <[EMAIL PROTECTED]> writes: > I have a database of e-mail addresses. > > I want to select the email addresses which are not valid: > > do not contain exactly one @ character, > contain ; > < " ' , characters or spaces etc. > > What is the WHERE clause for this ? > There was a thread

Re: [GENERAL] Select all invalid e-mail addresses

2005-10-20 Thread Hannes Dorbath
On 19.10.2005 21:18, Michael Fuhr wrote: One possibility would be to write a plperlu function that uses the Email::Valid module. Here's a trivial example; see the Email::Valid documentation to learn about its full capabilities: ..and if you don't mind installing pl/php, you can use this functi

Re: [GENERAL] Select all invalid e-mail addresses

2005-10-19 Thread Michael Fuhr
On Wed, Oct 19, 2005 at 09:12:16PM +0300, Andrus wrote: > I want to select the email addresses which are not valid: > > do not contain exactly one @ character, > contain ; > < " ' , characters or spaces etc. The rules that define a valid email address are more complex than most people realize, an

Re: [GENERAL] Select all invalid e-mail addresses

2005-10-19 Thread Guy Rouillier
Andrus wrote: > I have a database of e-mail addresses. > > I want to select the email addresses which are not valid: > > do not contain exactly one @ character, > contain ; > < " ' , characters or spaces etc. > > What is the WHERE clause for this ? Please see a long, detailed thread in the arch

Re: [GENERAL] Select all invalid e-mail addresses

2005-10-19 Thread Dann Corbit
: [GENERAL] Select all invalid e-mail addresses > > I have a database of e-mail addresses. > > I want to select the email addresses which are not valid: > > do not contain exactly one @ character, > contain ; > < " ' , characters or spaces et

[GENERAL] Select all invalid e-mail addresses

2005-10-19 Thread Andrus
I have a database of e-mail addresses. I want to select the email addresses which are not valid: do not contain exactly one @ character, contain ; > < " ' , characters or spaces etc. What is the WHERE clause for this ? Andrus. ---(end of broadcast)---