in reply to Re: Variable-width negative lookbehindin thread Variable-width negative lookbehind
$string =~ s/(?<=[^Y])X+//g; [download]