searching for matches within a word list

Rajarshi Guha rajarshi at
Tue Jul 29 23:35:58 CEST 2003

  I have a large list of words (each on its own line) 
and I would like to find words that contain a specific string.

I have been trying to use a regexp but I cant see how I can find the
word that contained the regex pattern - all I get is the pattern itself
if I use match or findall.

I know that I could just go through the list line by line and see if the
regex matches or not - but that method seems horifically inefficient.

Does anybody have any suggestions as to how I could solve this


More information about the Python-list mailing list