Link to home
Start Free TrialLog in
Avatar of kaplan1
kaplan1

asked on

Checking legal email address string

In my C++ program I need to check whether or not a string is a legal email address.
Does anyone know if there is a library function somewhere for doing this, and if
not, what are the rules for this function.
Avatar of ozo
ozo
Flag of United States of America image

Avatar of kashif063098
kashif063098

hi!
I think you need to check for few things in the string

1- '@' sign
2- '.' after @ sign
3- look for .net,.gov,.com,.org

i think you already know this

Here are some rules:

1. There must be no blank spaces.
2. There must be one (and only one) '@'-sign.
3. Only letters, numbers and following characters allowed:
   hyphen (-), dot (.) and underscore (_).
4. The part after the '@'-sign must contain at least one dot (.).

   I hope you will find it usefull.
ASKER CERTIFIED SOLUTION
Avatar of saneesh100
saneesh100

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
The proposed rules are incorrect.
More than one @ can appear in a valid email address,
as can blank spaces, or any other character when properly quoted.