Did you try to avoid re for this simple task and to use the string method 'split' instead (or the string module if you are using 1.5)? It defaults to any whitespace string as separator and should be faster: f = line.split() Matthias