0

What would be some basic pseudocode to describe input validation for emails? Something like:

Prompt user for email

Input == Email

...
jh314
  • 27,144
  • 16
  • 62
  • 82
dave
  • 41
  • 1
  • 6
  • Please include more specifics. Like the language. Or what you want to accomplish with validation ("looks like an email", actually is a registered email, etc.) – ryanyuyu Mar 19 '15 at 18:44
  • @ryanyuyu No language in particular, something close to general english language that looks code like lol – dave Mar 19 '15 at 18:46
  • Again, what do you want to validate? How do you want to define what makes an input a valid email? – ryanyuyu Mar 19 '15 at 18:47
  • @ryanyuyu a certain about of letters, numbers or -/_ then a @ symbol then a certain amount of letters then a . and 3 letters or 2 letters then a . then 2 more letters. – dave Mar 19 '15 at 19:30
  • Look into regex (regular expressions). They define rules to match a string. See also this [javascript regex solution](http://stackoverflow.com/questions/46155/validate-email-address-in-javascript). According to your rules specifically, something like `^[\w-]+@[\w.%+-]+\.\w{2,3}\.[A-Za-z]{2}$` would work. – ryanyuyu Mar 19 '15 at 20:02

0 Answers0