@archangelic so you want to take a string with embedded spaces and newlines and turn it into several strings each no longer than n characters without breaking mid-word?
something like this might work, or at least be a starting point (here, the limit is 140 characters)
re.findall('.{,139}(?:\s|$)', input_text)
the idea is "find all strings of characters up to 139 characters followed by either space or newline"