RFC 2822 indicates what a valid email address is, and this is discussed here . But, as this page notes, you cannot just accept it without reading and understanding what it is doing.
You have an advantage here, since you expect the address to always end with @gmail.com , which reduces the size of your regular expression (you can divide by @ and only check the first half).
BTW, GMail is not gmail.com worldwide - in the UK and Germany you will also find googlemail.com .
There is a lot of regular expression documentation around the Internet, but you should definitely read how the library / engine you use handles everything. There are slight differences between implementations.
alroc
source share