only one hyphen was replaced

The replace method only replaces the first occurence, so I changed it to regular expression.