I want to set up a regex to validate an email address but I also want it to validate only two types of email address. For instance I only want to accept @law.gt.edu and @gt.edu. Any thoughts?
Printable View
I want to set up a regex to validate an email address but I also want it to validate only two types of email address. For instance I only want to accept @law.gt.edu and @gt.edu. Any thoughts?
assuming the criteria of a valid email address is an identifier which is composed of: letter, dot, underscore, and hyphen. a possible regexp would be:
Code:/^[a-z0-9\-\._]+@(law\.gt\.edu|gt\.edu)$/i
I'm not expert with regular expressions, but you should be able to work soemthing out from this, plus you can check if it works.
http://quanetic.com/Regex