Ideally, I want to be able to apply two expressions in the same step. The First replace is to remove new lines and the second to replace redundant spaces before a comma where they occur.
value.replace(/\n/," ").replace(" ,",",")
I have tried this, which does not have syntax error but does not achieve the required result. Both expressions of course work individually.
If you're working with normal-ish text, using the Edit Cells -> Commons Transforms -> Trim leading and trailing whitespace and Collapse consecutive whitespace functions are useful normalizations to start out with. The latter also takes care of normalizing things like non-breaking spaces, half-width spaces, etc into a single plain space character.