faulkner wrote: > re.findall('\([^\)]*\)|\[[^\]]*|\S+', s) sorry i forgot to give a limitation: if a letter is next to a bracket, they should be considered as one word. i.e.: "a(b c) d" becomes ["a(b c)", "d"] because there is no blank between "a" and "(".
-- http://mail.python.org/mailman/listinfo/python-list