All pastes #169313 Raw Edit

Untitled

public python v1 · immutable
·published 2006-09-13 20:10 UTC
rendered paste body
import urllibimport sysimport reimport stringtarget_url = "http://www.pythonchallenge.com/pc/def/equality.html"text_re = re.compile(r'<!--(\D*)-->')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],