Vinay> I guess python can do the simple optimization of moving the regex Vinay> compilation outside the while loop. No, it's the re module itself. It caches regular expressions that it compiles from strings. Skip