Roy Smith <roy at panix.com> writes: >e1 = re.compile ('...') >e2 = re.compile ('...') >e3 = re.compile ('...') >line = file.readline() for e in [e1, e2, e3]: m = e.match(line) if m: text = m.group(1) break else: no match found Note that the 'else' belongs to the 'for', not to the 'if'. Regards, Ingo -- "I like VIM because, when I ask a question in this NG, I get a one-line answer. With xemacs, I get a 1Kb lisp script with bugs in it ;-)" -- wroot at my-deja.com in comp.editors, <948toi$ttt$1 at nnrp1.deja.com>
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4