Separar os caracteres de uma string com hífen em Python funciona perfeitamente desse jeito
import re
regex = r"B(?=(.{1}))"
test_str = "Pêssego"
subst = "-"
result = re.sub(regex, subst, test_str, 0)
if result:
print (result) // P-ê-s-s-e-g-o
Em javascript
const regex = /B(?=(.{1}))/g;
const str = `Pêssego`;
const subst = `-`;
const result = str.replace(regex, subst);
console.log(result); // Pês-s-e-g-o
Devo acrescentar algo? Tirar algo? Qual a diferença entre dos dois? Existe alguma outra forma de separar uma string com hifens em em tempo real em um campo de entrada?