Update: Answered the wrong question.
This is tougher than it looks.
Try m/(.{40}\n){4}/. It works for me...
perl> $" = '' perl> $s = ((qq(@{[0..8]}) x 4).$/)x4 perl> print $s 012345678012345678012345678012345678 012345678012345678012345678012345678 012345678012345678012345678012345678 012345678012345678012345678012345678 perl> print 'Matched'.$/ if ( $s =~ m/(.{40}\n){4}/ ) perl> $s = ((qq(@{[0..9]}) x 4).$/)x4 perl> print $s 0123456789012345678901234567890123456789 0123456789012345678901234567890123456789 0123456789012345678901234567890123456789 0123456789012345678901234567890123456789 perl> print 'Matched'.$/ if ( $s =~ m/(.{40}\n){4}/ ) Matched perl>
In reply to Re: How do I match lines of 40 characters long in a block of text?
by BrowserUk
in thread How do I match lines of 40 characters long in a block of text?
by kleinbiker7
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |