def all_links(html):
 ans = set()
 for match in re.finditer(u'<\\s*[Aa]\\s+.*?[hH][Rr][Ee][Ff]\\s*=\\s*([\'"])(.+?)\\1', html, (re.MULTILINE | re.DOTALL)):
  ans.add(replace_entities(match.group(2)))
 return ans

def all_links ( html ) : ans = set ( ) for match in re . finditer ( u'<\\s*[Aa]\\s+.*?[hH][Rr][Ee][Ff]\\s*=\\s*([\'"])(.+?)\\1' , html , ( re . MULTILINE | re . DOTALL ) ) : ans . add ( replace_entities ( match . group ( 2 ) ) ) return ans
return set of all links in the file .