Use RegEx to replace spaces instead of a string

Fixes #86.