sS gazelle_copyRuleWithNewIn(S ruleID, S newIn) {
  PairS p = dm_textAndCommentOfRule(ruleID);
  if (p == null) null;
  S newText = gazelle_replaceInOfRuleText(p.a, newIn);
  if (newText == null) null;
  gazelle_addRuleWithComment(newText, p.b);
  ret dm_gazelle_addRuleWithComment_msg!;
}