Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
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.s/(>[^<]*)([.\n]{80})/$1$2<BR>/sg
edit (broquaint): added formatting + <code> tags
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: inserting html tags after X characters
by fruiture (Curate) on Nov 01, 2002 at 16:10 UTC | |
Re: inserting html tags after X characters
by Rich36 (Chaplain) on Nov 01, 2002 at 17:52 UTC | |
by graff (Chancellor) on Nov 02, 2002 at 15:19 UTC |