the tags have to be zero characters long for the wrapping purposes.
That's more difficult. I would probably do it like this:
$_ = "foo<span>bar</span>bazqux<span>quux</span>"; my $c=0; s( (<span>|</span>|.) ) { my $s = $1; $s =~ m!</?span>! ? $s : $s . (++$c % 4 ? '' : "\n"); }sxge; print; print "\n";
That will show you how it works but in your case you'll need to change that '4' to '80' in the ++$c % 4 part.
Update: added /s to regex so . would match "\n" as well.
-sauoq "My two cents aren't worth a dime.";
In reply to Re: Re: Re: highlight and line breaks
by sauoq
in thread highlight and line breaks
by glwtta
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |