[thelist] Perl - regular expressions

Roee Rubin webdesign1 at irubin.com
Sat Dec 8 10:59:07 CST 2001


Hello,

This question involves splitting up a paragraph, take for example the
following paragraph:

"Nine state attorneys general argued Friday that Microsoft must offer a
stripped-down version of its Windows operating system and make its leading
Office software compatible with competing operating systems"

I would like to split the paragraph into two parts (which ultimately will be
displayed in two pages). The trick, however is that I do not wish to split
in the middle of the word. I have a budget of, lets say 99 characters which
will split the word "its" right in the middle. I would like page to
essentially display up to character 99 minus first (or last) white space (I
think that makes sense).

The second page will display from character 99 (minus the white space) until
the end.

The end result in this case should look like this:

Page 1

"Nine state attorneys general argued Friday that Microsoft must offer a
stripped-down version of"

Page 2

"its Windows operating system and make its leading Office software
compatible with competing operating systems"


TIA

Roee Rubin
roee at irubin.com






More information about the thelist mailing list