I have a table as follows:

```
    uri               | country
----------------------+--------
http://www.A.com      |   NL
http://www.A.com/sub  |   NL
https://www.B.com     |   NL
http://C.com          |   DL

```

I need a select query (including regex) to show distinct rows without uri. 

```
Desired outcome:
    www.A.com      NL
    www.B.com      NL
    C.com          DL

```

I tried [this](https://stackoverflow.com/questions/17750657/substring-regex-for-first-part-of-url):

```
select distinct substring(uri from '(https?://([^/]*/){1,2})'),country from list;

```

But the regex cannot handle simple domain like: www.A.com 
It is only working for www.A.com/sub

Any idea?