pemurray
asked on
Email Address Validation - Failing on space in string
Greetings All,
I have code from buasuwan that allows me to check an email address to make sure it is properly formatted. But it still seems to allow an email address to pass if it has a space in it. I am not sure what is wrong. Can someone help please?
Here is the code and pattern:
If email1 <> "" then
if match(email1,'^[a-zA-Z0-9] [a-zA-Z\0- 9\-_\.]*[^ .]\@[^.][a -zA-Z\0-9\ -_\.]+\.[a -zA-Z\0-9\ -_\.]*[a-z A-Z\0-9]+$ ') then
email1flag = 'Y'
end if
end if
I have code from buasuwan that allows me to check an email address to make sure it is properly formatted. But it still seems to allow an email address to pass if it has a space in it. I am not sure what is wrong. Can someone help please?
Here is the code and pattern:
If email1 <> "" then
if match(email1,'^[a-zA-Z0-9]
email1flag = 'Y'
end if
end if
If email1 <> "" then
if match(email1,'^[a-zA-Z0-9][a-zA-Z\0-9\-_\.]*[^.]\@[^.][a-zA-Z\0-9\-_\.]+\.[a-zA-Z\0-9\-_\.]*[a-zA-Z\0-9]+$') then
email1flag = 'Y'
end if
end if
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.