I am trying to match a regex for an email address with the following conditions.
- String must not contain more than 40 characters.
- String matches the format emailid@domain where both emailid and domain contains only lowercase English letters, digits, and period(.)
- domain should contain at least one period(.)
- both email id and domain must not contain any consecutive period (.)
So Far, I am able to fulfill only the second condition with this regex:
/^[a-z0-9.]+@[a-z0-9.-]+\.[a-zA-Z]{2,6}$/
Any idea, how can I complete the other conditions?