While this may be good for code under 100 lines, anything more requires using Google. Either it be simple trivial things like email regexp (for those who don't have the luxury of having premade libraries for them) or harder things like algorithms.
If you really really want to validate an email then force the user to verify it.