while($text =~ /(\b.{0,78}\b)/g){ push @array, $1; } -----Original Message----- From: Oliver Andrich To: [EMAIL PROTECTED] Sent: 3/22/02 2:46 PM Subject: Regex or code sample to split a text line
Hi, I am currently stuck with developing an elegant solution for splitting a long text line into an array of strings of the certain maximum length and it should be split at online at word bounderies. So, my criterias are max length (78 chars) and split at \b. Is there any standard routine to do this. I played with Text::Wrap, but this does the opposite of my requirements. It takes a list of strings and formats them in such a way that one result string is generated that fits the requirements. Any modul to solve this the other direction. Best regards, Oliver -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -------------------------------------------------------------------------------- This email may contain confidential and privileged material for the sole use of the intended recipient. If you are not the intended recipient, please contact the sender and delete all copies. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]