in reply to
Variable-width negative lookbehind
How about the lovely and talented
/e
?
$string =~ s/(.)X+/$1 eq 'Y' ? YX : $1/eg;
Comment on
Re: Variable-width negative lookbehind
Select
or
Download
Code
In Section
Seekers of Perl Wisdom