iterating over lines in a file

Cliff Crawford cjc26 at nospam.cornell.edu
Thu Jul 27 14:38:18 EDT 2000


* nobody <no at bo.dy> menulis:
| 
| > Also, in your example you'd probably want to use search() rather than
| > match(), which only succeeds if the regexp matches the beginning of the
| > string (i.e. it acts as if there is an implicit '^' at the beginning of
| > the regexp).
| 
| hm. any difference in performance, or can i just as well make the caret
| explicit and standardize myself on match?

Er, what I meant was that match() only succeeds if the regexp matches
the beginning of the string, while search() will succeed if the regexp
matches anywhere in the string.  I doubt there's any difference in
performance.


-- 
cliff crawford    -><-    http://www.people.cornell.edu/pages/cjc26/
                         "But why is it TILED?!?"      icq 68165166



More information about the Python-list mailing list