import re regex = r"(?<=\w)-\r?\n(?=\w)"my_string = """this good pe-riod has""" print (re.sub(regex, "", my_string))
Standard input is empty
this good period has
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!