Replacing spaces in a string, the RegExp way

Hi Crew,
So I’d like to remove all spaces from an input text box, and replace them with commas, and I’d like to learn how to do this with RegExp, which I’ve never before used.

This doesn’t work (though if I do s.search(re) it returns the first space):

var s:String = searchTerms.text;
var re:RegExp = /\s/g;
s.replace(re, ",");
trace(s);

Thanks for any help you can provide!