I have some code to remove all punctuation characters:
mysentence.components(separatedBy: .punctuationCharacters).joined().components(separatedBy: " ")
Now, I am trying to add an exception for the dash character "-". In other words, I want to remove all punctuation EXCEPT for dashes.
It looks like in Java this can be done with replaceall using a regular expression (which admittedly I don't know how to use). How might I do this in Swift 4?