But if I'm allowed to execute code, than the constraint "do it in a single regexp" isn't a constraint at all.So here we go with 3 regexps and no code execution (exept for initializing and printing):
$_="x" x 30; s:xx:$' $`$&\n:g; s:(?<=\n).*:$&$`$`:s; s/xx(?=(x*)(\1) )/ /g; print;
In reply to Re^2: Resetting pos() within a RegEx?
by Skeeve
in thread Resetting pos() within a RegEx?
by LanX
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |