_ExtractEmailDomain ( )

Function stats

Average user rating
281
318
9999
Support
FileMaker 7.0 +
Date posted
20 December 2011
Version
1
Recursive function
No

Author Info
 Marcelo Piñeyro

3 functions

Average Rating None

author_avatar



 

Function overview

Prototype

_ExtractEmailDomain  ( emailAddress )


Parameters

emailAddress  


Description

Tags:  Text Parsing   Email  

Extracts the domain name (without the extension) from an email address

Examples

Sample input

marcelo@wingraconsulting.com


Sample output

wingraconsulting

 

Function code

/*
Name:
_ExtractEmailDomain

History:
Created by Marcelo Piñeyro, Wingra Consulting LLC, marcelo@wingraconsulting.com
Date created: December 19, 2011
Date modified: ---

Purpose: To extract the domain name (without the extension) from an email address


Parameters: an email address


Dependencies: none


Example: _ExtractEmailDomain ( "marcelo@wingraconsulting.com" ) returns wingraconsulting

*/

Let([
    email = emailAddress ;
    p1 = Position( email ; "@" ; 1 ; 1 ) ;
    p2 = Position( email ; "." ; p1 ; 1 )
] ;
    Middle( email ; p1 + 1 ; p2 - p1 - 1 )
)

// ===================================
/*

    This function is published on FileMaker Custom Functions
    to check for updates and provide feedback and bug reports
    please visit http://www.fmfunctions.com/fid/318

    Prototype: _ExtractEmailDomain( emailAddress )
    Function Author: Marcelo Piñeyro (http://www.fmfunctions.com/mid/281)
    Last updated: 20 December 2011
    Version: 1

*/
// ===================================

 

 

 

 

 

 

 

Top Tags

Text Parsing  (31)
List  (28)
Date  (26)
Format  (23)
XML  (22)
Dev  (19)
Sql  (18)
Debug  (16)
Interface  (13)
Text  (13)
Layout  (13)
Variables  (12)
Filter  (11)
Design  (10)
Layout Objects  (8)
Timestamp  (7)