in reply to replace all but first
1 while s/^([^A]*A[^A]*)A/$1a/; [download]
-QM -- Quantum Mechanics: The dreams stuff is made of