We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Detect the Domain Name
Detect the Domain Name
Sort by
recency
|
165 Discussions
|
Please Login in order to post a comment
import re import sys
html= sys.stdin.read()
pattern= r'https?://(?:www.|ww2.)?([a-zA-Z0-9-]+.?[a-zA-Z0-9-]+.[a-zA-Z].?[a-zA-Z])'
matches=re.findall(pattern,html)
output=sorted(set(url for url in matches))
print(';'.join(output))
I think there is a problem with the expected output of Test case 1. If you inspect the inputs (html). You can see these lines:
however, those 2 urls does not appear in the expected output
Java 15
Python 3