[thelist] Perl - regular expressions
Mal Wins
malwinsc at yahoo.com
Sat Dec 8 14:03:07 CST 2001
--- Dean Mah <dmah at shaw.ca> wrote:
> Try something like:
>
> while ($var =~ /(.{1,99})[\s\n]/g) {
> print "$1\n\n";
> }
Next time, I'll try to remember he wanted a regex.
doh.
Above was much closer to the mark
$var =~ /(.{1,99})[\s\n]/;
print "$1\n\n";
print $';
Works far as I can tell, a new line before 99 catches
though. Back to lurking :)
> Roee Rubin writes:
>
> > I would like to split the paragraph into two parts
> (which ultimately will be
> > displayed in two pages).
__________________________________________________
Do You Yahoo!?
Send your FREE holiday greetings online!
http://greetings.yahoo.com
More information about the thelist
mailing list