$finaloutput =~ s/(.{0,76}\s)/$1\r\n/g;
This simply asks for "between zero and 76 characters followed by whitespace". Since it's a greedy match by default it will always grab the most. You may need to change the upper limit to 75 if you want it to be 76 including the space, I don't know if that's the case.In reply to Easy Solution
by Sprenger000
in thread Matching positions with lookarounds
by blahblah
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |