in reply to Removing unwanted characters

s/[^A-Za-z0-9]/ /g;
_each_ unwanted character will be replaced by a single space. Is this what you want? Your regex would replace one _group_ of unwanted characters with a space.