Hi,
I am trying to break up a long character string in an html document when it is displayed on a web page by inserting a
tag after every 80 characters that occur in the document outside the pre-existing html tags. I've tried this:
s/(>[^<]*)([.\n]{80})/$1$2<BR>/sg
but the problem is that is "resets" its counter every time it encounters a html tag. Ie. If it finds 72 characters, then an html tag, I want it to be resume counting at 73 once it leaves the tag, instead it will not insert a
<BR> until it finds an "unbroken" string of 80 characters. Is there way to do this with a single regular expression, or will I need multiple lines of code? Thanks.
edit (broquaint): added formatting + <code> tags