wasm-demo/demo/ermis-f/python_m/cur/0326

23 lines
583 B
Plaintext

From: tjreedy at udel.edu (Terry Reedy)
Date: 25 Apr 1999 01:58:48 GMT
Subject: wrapped around the axle on regexpressions and file searching
References: <7frhe0$8g1$1@nnrp1.dejanews.com>
Message-ID: <7ftsso$r0$1@news.udel.edu>
X-UID: 326
[code to find and process files ending in .log]
>2. is there a better, faster way of doing this??,
For matching literal text, string.find, .rfind, .index, .rindex
are faster that regexes. Since you want to match text at end only,
if filename[-4:] == '.log'
will be even faster.
TJR