In that case you don't want a regex at all. Use substr.
use strict; use warnings; my $str = do {local $/; <DATA>}; $str =~ s/\s+//g; my $len = length $str; for (my $width = 5; $width; --$width) { for (0..($len - $width)) { print substr ($str, $_, $width) . "\n"; } } __DATA__ ABCDEFGHIJK
ABCDE BCDEF CDEFG DEFGH EFGHI FGHIJ GHIJK ABCD BCDE CDEF DEFG EFGH FGHI GHIJ HIJK ABC BCD CDE DEF EFG FGH GHI HIJ IJK AB BC CD DE EF FG GH HI IJ JK A B C D E F G H I J K
In reply to Re^3: Capture Lookahead
by GrandFather
in thread Capture Lookahead
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |