I am trying to make a function that will do this:

* Make sure there isn't a `.` at the beginning or at the end of a domain.
* Make sure there aren't two `.` in the domain.
* Make sure there is at least one `.` in the domain.

Like blabla@outlook.com, it's suppose to make sure it isn't:

```
.blabla@outlook.com.
blabla@outlook..com

```

and that it is blabla@outlook.com

Here is my code for correcting domain:

```
import re
def correct_domain(domain):

    if re.search(r'^\.|.$', domain) and re.search(r'\.\.', domain):
        return False
    else re.search(r'\.', domain):
        return True

```