The word character and a space are not mutually interchangeable.


1. Where did you get that requirement from?
2. The OP's question was about regexes. String#replace has nothing whatsoever to...