Anyone know of a regular expression that will only match emails that contain a sub-domain in them?

**e.g.,**

`name@subdomain.domain.com` or `name@subdomain.domain.edu.au`

Preferably to use in [postgresql](/questions/tagged/postgresql "show questions tagged 'postgresql'").

**I tried this:**

```
^[-+.0-9A-Z_a-z]+@[-+.0-9A-Z_a-z]+\.[A-Za-z]{2,4}$

```

but it also matches `name@test.org`.