regex to replace trailing property name fixed, and test updated