FMPRO-L Archives

December 2010, Week 1

FMPRO-L@LISTSERV.DARTMOUTH.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Reply To:
FileMaker Pro Discussions <[log in to unmask]>
Date:
Mon, 6 Dec 2010 00:36:47 -0600
Content-Type:
text/plain
Parts/Attachments:
text/plain (40 lines)
Michael Rhodes has a good one for modern versions:

/*
Created October 12, 2008
Updated December 5, 2010

Since new top-level domains are constantly added, this function assumes the top-level domain is legitimate and validates only the email format.
Returns a True value if the parameter is a correctly formatted email address.

Created by Michael Rhodes
[log in to unmask]
Anybody may use this function so long as they keep my contact info in the comments of the function.
*/

IsEmpty ( text )
or
Let ( [
   alphanum = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789" ;
   textEnds = Left ( text; 1 ) & Right ( text; 1 ) ;
   posDomain = Position ( text; "@"; 1; 1 ) ;
   domain = If ( posDomain; Right ( text; Length ( text ) - posDomain ) ) ;
   leftChar = Left ( domain; 1 ) ;
   posTLD = If ( posDomain; Position ( domain; "."; 1; 1 ) ) ;
   TLD = If ( posTLD; Right ( domain; Length ( domain ) - posTLD ) )
] ;
   Filter ( text; alphanum & "[log in to unmask]" ) = text   // There are no invalid characters.
   and PatternCount ( text; "@" ) = 1   // There is only one @ symbol.
   and Filter ( textEnds; alphanum) = textEnds   // First and last character are alphanumeric.
   and not Position ( text; ".."; 1; 1 )
   and Middle ( text; posDomain - 1; 1 ) <> "."
   and Filter ( leftChar; alphanum ) = leftChar
   and not IsEmpty ( TLD )
) // end let

Anyone have any suggestions for version 6?


Start Here to Find It Fast!™ -> http://www.US-Webmasters.com/best-start-page/
$8.77 Domain Names -> http://domains.us-webmasters.com/

ATOM RSS1 RSS2