You are viewing a single comment's thread. Return to all comments →
Python 3
import re import sys n = int(input()) html = sys.stdin.read() pattern = r'<a\s.*?href="(.*?)".*?>\s*([^<>]*?)</' matches = re.findall(pattern, html) for match in matches: print(match[0], match[1], sep=",")
Seems like cookies are disabled on this browser, please enable them to open this website
An unexpected error occurred. Please try reloading the page. If problem persists, please contact support@hackerrank.com
Detect HTML links
You are viewing a single comment's thread. Return to all comments →
Python 3