Screen Link:
https://app.dataquest.io/m/369/advanced-regular-expressions/8/extracting-domains-from-urls
My Code:
#pattern = r'https?://([\w-]+\.[\w-]+\.?[\w-]?)' (Please ignore this)
Edit - r'https?://([\w-]+\.[\w-]+\.?[\w-]*)'
test_urls_clean = test_urls.str.extract(pattern, flags=re.I)
domains = hn['url'].str.extract(pattern, flags=re.I)
top_domains = domains.value_counts().head(5)
What I expected to happen:
The solution above gives the correct results and should be accepted.
What actually happened:
No error message is shown but until we give the regex pattern as in the solution answer, it is not allowing to submit and pass the exercise.