Shouldn't the backslash be inside the second bracket, i.e.
`value = value.replace(/{?(\\[a-z]){?(\\?[A-Za-z])}/g, "{$1 $2}");`
for example for \H{\i} (if this letter exists)?