"Jay" <[EMAIL PROTECTED]> writes: > Let's say, for instance, that one was programming a spell checker or > some other function where the contents of a string from a text-editor's > text box needed to be split so that the resulting array has each word > as an element. Is there a shortcut to do this and, if not, what's the > best and most efficient token group for the split function to achieve > this?
I'd just use alphabetic strings: textbox = 'Apple pie and penguins' words = re.findall('[a-z]+', textbox, re.I) -- http://mail.python.org/mailman/listinfo/python-list