I'm trying to get the domain and tld from an http\_host by using the following regexp:

```
(?:^|\.)(.+?\.(?:it|com))

```

The regexp works correctly in gskinner.com.

Input: 

```
domain.com
www.domain.com

```

Captured groups in both:

```
domain.com

```

However in php the following:

```
preg_match("/(?:^|\.)(.+?\.(?:it|com))/", "www.domain.com", $matches);
print_r($matches);

```

Output:

```
Array
(
    [0] => www.baloodealer.com
    [1] => www.baloodealer.com
)

```

What's wrong with this?