import urllib import sys import re import string target_url = "http://www.pythonchallenge.com/pc/def/equality.html" text_re = re.compile(r'') answer_re = re.compile('[a-z][A-Z]{3,3}[a-z][A-Z]{3,3}[a-z]') if __name__ == "__main__": try: target_text = urllib.urlopen(target_url).read() except IOError, e: print "Failed!" sys.exit() r = text_re.findall(target_text)[0] if r: l = answer_re.findall(r) for a in l: print a[4],