[FixRM #8316] - Escape characters correctly

dots need to be escaped
Land #2256, @wchen-r7's patch for [FixRM #8316]