I want to replace dashes which appear between letters with a space using regex. For example to replace ab-cd with ab cd
The following matches the character-character sequence, however also replaces the characters [i.e. ab-cd results in a d, rather than ab cd as i desire]
new_term = re.sub(r"[A-z]\-[A-z]", " ", original_term)
How i adapt the above to only replace the - part?
-with a space in the given string? Is using regex necessary?ab-cd, but not to changeab - cd- [replacedoesn't have that control].