I'm trying to text wrap a string but not using the textwrap module. I have 24x9 "matrix" and the string needs to be text wrapped according to those dimensions. Is there a known algorithm for this? Maybe some kind of regular expression? I'm having difficulty programming the algorithm. Thanks, Ryan