The idea is not to use conditions (replace with this if it has a space, and with that otherwise), but to include all cases in the same condition (replace "..." preceded by zero or more spaces, all of that, with " …").
If you want to be more specific (replace only if there is a letter before the zero-or-more spaces, replace at most one space, etc.) it can be done too.
|