$s =~s{A\K([^A]+)(?=A)} {"A" x length $1 };
s{A\K([^A]+)(?=A)} {"A" x length $1 } is missing the /eg modifiers. See s/// (https://perldoc.perl.org/perlop#s/PATTERN/REPLACEMENT/msixpodualngcer) in perlop.
Give a man a fish: <%-{-{-{-<
In reply to Re^3: Replace all characters inbetween
by AnomalousMonk
in thread Replace all characters inbetween
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |