I have created a "lite" URL regex. That means it may not detect all URLs. I created it with the aim of covering simple urls.
#! python3
# urls.py - Detecting urls that begin with http:// or https://
import re
urlRegex = re.compile(r'''(
(http://|https://)+ # the http(s) part of the url
(w{3}\.)? # the world-wide-web part
([a-z0-9-])+ # the domain name
(\.[a-z]{2,4})? # sub level domain
(\.[a-z]{2,4}) # top level domain
(/[-A-Za-z0-9+&@#/%=~_|])* # extension i.e paths
)''', re.VERBOSE)
test = urlRegex.search('https://www.facebook.com/user_2033')
The output of test.groups() was this
('https://www.facebook.com/user_2033', 'https://', 'www.', 'k', None, '.com', '/u')
[Finished in 0.058s]
After numerous attempts, I'm unable to display the complete website name and extension i.e 'facebook' not 'k'. Any help without completely changing my own code would be most appreciated