Construct a Regex statement to extract the links from given text.
The following page has a list of useful links: www.example.com/links
```
import re

text = "The following page has a list of useful links: www.example.com/links"
pattern = r"http\S+|www\S+"

links = re.findall(pattern, text)

print(links)
```
Complete the following task based on the instruction and optional input provided.### Instruction:
Construct a Regex statement to extract the links from given text.

### Input:
The following page has a list of useful links: www.example.com/links

### Output:
```
import re

text = "The following page has a list of useful links: www.example.com/links"
pattern = r"http\S+|www\S+"

links = re.findall(pattern, text)

print(links)
```