Hello I need to parse an HTML file where records aren't homogenous, so I figured I could run a first loop to add an unused character at the beginning of each record, and then run a second loop to actually parse each record.
I can't figure out why the script is not returning anything in the "for m in matches" block: ========= f = open("input.txt", "r") response = f.read() f.close() #Pass 1: Add some character to separate records #response.replace('<li class="N2"','µ<li class="N2"') reponse = response.replace('<li class="N2"','µ<li class="N2"') p = re.compile('µ') index=1 matches = p.finditer(response) #Python doesn't display anything :-/ for m in matches: print "Found %s" % str(index) index = index + 1 ========= Any idea what I could be doing wrong? Thank you for any tip. -- http://mail.python.org/mailman/listinfo/python-list