On Fri, Nov 21, 2003 at 09:24:55PM -0000, Alan Gauld wrote: > You can either use a nested loop or more usefully a regular > expression: > > import re,string > > regex = "[%s]" % string.printable > > printable = re.compile(regex) You need to escape: regex = "[%s]" % re.escape(string.printable) Haven't tested that either though. Cheers, Neil