次の入力と出力を実現できるPythonの文字列操作はありますか?正規表現を使用する場合、正規表現は部分文字列をどのように置き換えますか?
#inputs
y = sentence-with-dashes
x = this is a sentence with dashes
#output
z = this is a sentence-with-dashes
#####################################
#sometimes the input is pretty messed up like this
y = sentence-with-dashes
x = this is a sentence-with dashes
#output
z = this is a sentence-with-dashes