No loop but 2 regexps:
$_="x" x 30; s:xx:(" " x (length($')/2))."$`$&\n":ge; s:(?<=\n).*:$&$`$`:s; print;
In reply to Re: Resetting pos() within a RegEx?
by Skeeve
in thread Resetting pos() within a RegEx?
by LanX
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |