A simper option instead of using regular expressions to insert the breaks is to use Text::Wrap. Once you've got the string of text from the HTML tags, use Text::Wrap (setting the columns to 80 characters) on the text. You could then substitute the "\n"'s for "<br>\n" for the HTML line breaks in the string.
In reply to Re: inserting html tags after X characters
by Rich36
in thread inserting html tags after X characters
by Anonymous Monk
For: | Use: | ||
& | & | ||
< | < | ||
> | > | ||
[ | [ | ||
] | ] |