The statement
Regex.Replace(\"XB\", \"([^A])B\", \"$1AB\")
produces XAB, as expected. Can someone explain me why
XAB
R
All B's not preceded by a A by AB.
Find: (? Replace: AB
(? Replace: AB
AB