returns original string if no replacements made. original commit: 3316c77cf0d4c575585b7f68d9d4a74a910b37d5