Regex consecutive characters swift 3

I want to a regex which excludes consective dot characters and excludes dot(.) in start and end of email.
Here is snippet


let emailRegEx = "[^.][A-Z0-9a-z_%+-.]+[^.]@[A-Za-z0-9-]+\\.[A-Za-z]{3,10}"

let emailPredicate = NSPredicate(format: "SELF MATCHES %@", emailRegEx)

return emailPredicate.evaluateWithObject(emailString)


I acheieved 2nd part. Can some one help me with regex to exclude consecutive dot (.) characters in the email before @?.


Thanks

Before stepping ahead to consecutive dot characters, your pattern `emailRegEx` matches to "?a*@oopers.com" or " x @oopers.com".

Your pattern excludes dot(.) in start and end of email, but it includes any other characters than dot(.) for both ends. Is this what you want?

Regex consecutive characters swift 3
 
 
Q