The '\K' and '(?=...)' parts are explained in Lookaround Assertions under "perlre: Extended Patterns".
You can use Regexp::Debugger to see what's happening (step-by-step) as a regex is processed. I find this to be a very useful tool.
— Ken
In reply to Re^3: Help in joining these lines
by kcott
in thread Help in joining these lines
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |