$string =~ /^Y?X?/; substr($string, $+[0]) =~ tr/X//d; [download]
In reply to Re: Re: Variable-width negative lookbehind by Roy Johnson in thread Variable-width negative lookbehind by dragonchild