× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



By my read of http://www.faqs.org/rfcs/rfc822.html it's any character
between ASCII 33 and 126 inclusive except ()<>@,;:\".[]

Look at the definition of local-part at the end. Basically it's one or more
words separated by a (.). A word is an atom or quoted string (we'll ignore
quoted strings). An atom is any CHARs except specials, SPACE and CTLs.

CHAR is anything between 0 and 127
Specials are ()<>@,;:\".[]
CTLs are 0-31
SPACE is 32

-Walden

------------
Walden H Leverich III
President & CEO
Tech Software
(516) 627-3800 x11
(208) 692-3308 eFax
WaldenL@xxxxxxxxxxxxxxx
http://www.TechSoftInc.com 

Quiquid latine dictum sit altum viditur.
(Whatever is said in Latin seems profound.)
 
-----Original Message-----
From: rob@xxxxxxxxx [mailto:rob@xxxxxxxxx] 
Sent: Monday, January 12, 2004 4:41 PM
To: Midrange Systems Technical Discussion
Subject: Re: What are the valid characters in an email address?

Booth,

This is what the SQL User Defined Function STRIPEMAIL() does.  I created 
an rpg service program to do just about what you said.  I was just trying 
to figure out what to put in the variable ValidEmailChar.

      /DEFINE DSpec
      /INCLUDE ROUTINES/QPROTOSRC,STRIPEMAIL
      /UNDEFINE DSpec

      /EJECT
     P STRIPEMAIL      B                   export
     D STRIPEMAIL      PI                  like(EmailAddress)
     D  SourceString                512a   const

     D Domain          s            100a   varying
     D Person          s            100a   varying
     D EmailAddress    s            100a   inz(*loval)
     D AtSignPos       s              5i 0 inz(*zero)
     D BlankBefore     s              5i 0 inz(*zero)
     D BlankAfter      s              5i 0 inz(*zero)
     D ValidEmailChar  c                   'ABCDEFGHIJKLMNOPQRSTUVWXYZ-
     D                                     abcdefghijklmnopqrstuvwxyz-
     D                                     0123456789/%._-'

      /free
       reset AtSignPos;
       reset BlankBefore;
       reset BlankAfter;
       reset EmailAddress;
       AtSignPos=%scan('@' : SourceString : 1);
       Select;
       When AtSignPos=0;
         // Invalid email address, no @
         return EmailAddress;
       When AtSignPos<2;
         // Invalid email address, @ is in first position
         return EmailAddress;
       When AtSignPos>(%len(SourceString) - 2);
         // Invalid email address, @ is too close to end
         return EmailAddress;
       Other;
         // reasonable position for '@'
         BlankAfter=%check(ValidEmailChar : SourceString : AtSignPos + 1);
         Select;
         When BlankAfter < (5 + AtSignPos);
           // Invalid email address - no valid domain, even x.de takes 4 
characters
           return EmailAddress;
         When BlankAfter=0;
           Domain=%subst(SourceString : AtSignPos + 1 :
                         %len(SourceString) - AtSignPos);
         Other;
           Domain=%subst(SourceString : AtSignPos + 1 :
                          BlankAfter - AtSignPos - 1);
         EndSl;
         BlankBefore=%checkr(ValidEmailChar : SourceString : AtSignPos - 
1);
         Person=%subst(SourceString : BlankBefore + 1:
                       AtSignPos - BlankBefore - 1);
       EndSl;
       EmailAddress=Person + '@' + Domain;
       return EmailAddress;
      /end-free
     P StripEmail      E

Rob Berendt
-- 
"All creatures will make merry... under pain of death."
-Ming the Merciless (Flash Gordon)




"Booth Martin" <Booth@xxxxxxxxxxxx> 
Sent by: midrange-l-bounces@xxxxxxxxxxxx
01/12/2004 04:09 PM
Please respond to
Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxx>


To
<midrange-l@xxxxxxxxxxxx>
cc

Fax to

Subject
Re: What are the valid characters in an email address?






Since the @ sign seems to be universal to your problem can you scan for 
the
@ signs, and then scan left and right  for the first blanks or first
parentheses?  Could you also xlate the parentheses to blanks, then scan 
left
and right for just the first blank?  Would there be too many false
positives?  If there were false positives would it be serious?
 

---------------------------------------------------------
Booth Martin   http://www.MartinVT.com
Booth@xxxxxxxxxxxx
---------------------------------------------------------
 
-------Original Message-------
 
From: Midrange Systems Technical Discussion
Date: 1/12/2004 2:50:02 PM
To: Midrange Systems Technical Discussion
Subject: Re: What are the valid characters in an email address?
 
Scott,
 
In the msf journals I have one field containing several data elements.  I
have to strip out the email address which "generally" starts in the same
place.  The problem is that an acceptance and a rejection may have the
same email address, however one may have put the <...> around it.  I am
trying to strip it down to the basics so that they look the same.  Then I
am going to use SQL to find sends without either an acceptance or a
rejection.  Bad enough I am using a UDF to strip out the email.  Using a
UDF to validate domain names via your method may get even slower.
_______________________________________________
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing 
list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.


_______________________________________________
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.

As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.