Regular expression for validating email in c

The NSRegular Expression class is used to represent and apply regular expressions to Unicode strings.

Are there any other approaches than the ones I've listed?List emails = new Array List(); emails.add("[email protected]"); emails.add("[email protected]"); emails.add("[email protected]"); emails.add("[email protected]"); emails.add("[email protected]"); emails.add("[email protected]"); emails.add("[email protected]"); //Invalid emails emails.add("@yahoo.com"); String regex = "^[A-Za-z0-9 _.-] @(.)$"; Pattern pattern = Pattern.compile(regex); for(String email : emails) Output: [email protected]: true [email protected] : true [email protected]: true [email protected]: true [email protected] : true [email protected] : true [email protected] : true @: false This regex example uses all the characters permitted by RFC 5322, which governs the email message format. :[a-z A-Z0-9-] \.) [a-z A-Z]$"; Pattern pattern = Pattern.compile(regex); for(String email : emails) Output: [email protected]: true [email protected] : true [email protected]: true [email protected]: true [email protected]: true [email protected]: false [email protected] have to write a program to validate an email address. I wanted to work through everything individually, and I sort of understand what you were doing.not really.To do this I have to use the following criteria: •The email address must start with a letter (no numbers or symbols) •There must be an @ somewhere in the string that is located BEFORE the dot •There must be text after the @ symbol but BEFORE the dot •There must be a dot •There must be text after the dot I have started the program..I cannot figure out how to use correctly. I understand your sentiment, but while you may be helping some people by giving them code, those that learn nothing are actually being hindered.