You selected the correct regexp, you just have to quote it to use it in Python. You also need to call re.findall(), it’s not a string method.

import re

txt = 'I refer to and i never refer'
print(re.findall(r'(?<=https:\/\/)([A-Za-z0-9.]*)', txt))

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top