I'm trying to extract a substring from a large string that matches my pattern.
text = 'This is a large subsring. bla bla bla AND www.dumbweb.com/Dumbo and www.otherLinks.com...'
pattern = 'dumbweb.com'
here i'm trying to find the string that matches pattern
theLink = re.findall(pattern, text)
print(theLink) //output: dumbweb.com
but i'm only able to find the exact text that i'm searching with, i'm trying to get the full string split by space
desired output:
theLink //www.dumbweb.com/Dumbo
i tired searching for similar question but i'm not able to phrase it right, i even looked up the Python Regex still not able to achieve what i'm looking for.
print([k for k in text.split() if 'dumbweb.com' in k])