import reprint (re.sub(r"(?<=[A-Za-z])-(?=[A-Za-z])", " ", "ab-cd-1"))print (re.sub(r"([A-Z])-(?=[A-Za-z])", r"\1 ", "ab-cd-1"))
Standard input is empty
ab cd-1 ab-cd-1
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!