Check for bad email address

From Starfish ETL
Jump to navigation Jump to search
Function ScriptedField
	Dim regEx, retVal
	dim res

	Set regEx = New RegExp
	res = "[{""email_address"":""@@ORG:email@@""}]"

	' Create regular expression:
	regEx.Pattern ="^[\w-\.]{1,}\@([\da-zA-Z-]{1,}\.){1,}[\da-zA-Z-]{2,3}$"	

	' Set pattern:
	regEx.IgnoreCase = true

	' Set case sensitivity.
	If "@@ORG:email@@" <> "" Then
		retVal = regEx.Test("@@ORG:email@@")
		If retVal = False Then
			LogMessage "Error: Bad Email Address.  Email:@@ORG:email@@; SeedwareID:@@ORG:seedware_id@@; AccountName:@@ORG:account_name@@"
		End If	
	End If
End Function