in reply to look behind in REs

You *could* do it in three steps:
my $string = "AAbfwercB(A)fjklASZaB(A)xvASABAB(A)gfdaZAA"; my @chunks = split(/B\(A\)/, $_); $_ =~ tr/A/Z/ foreach @chunks; $string = join 'B(A)', @chunks;
My guess is that it's a little slow, though. I'd reverse $string first, myself.