I am trying to create an expression to validate Gmail addresses. That's what I've done so far.

^([\w]*[\w\.]*(?!\.)@gmail.com)

I am trying to create an expression to validate Gmail addresses. That's what I've done so far.

But it isn't working as I want.

Gmail address:

  1. First and last character has to be [a-z0-9]
  2. The username contents only [a-z0-9.]
  3. There cannot be consecutive periods (i.e: e..o@gmail.com [This is wrong])
  4. There length of the username has to be between 6 and 30 letters.

Being honest I don't have much experience with the Regular Expressions.

By the way, is there a documentation for Regular Expression?

Edit
Report