Well, I finally did it. I ++'d an anonymous post. Good answer. I was going to say something like:
[^\s\w] means neither spaces nor words, or, everything but spaces and words, where [\S\W] means non-spaces AND non-words, and since a space is a non-word, the meaning is similar to "non-spaces and spaces".
Wait a minute.... I just tried your example and it still wipes out the string. It's like a nice big OR isn't it? So isn't s/[\S]|[\W]//g really the same as s/[\S\W]//g?
Edit: A negative demark for pointing out this out? Bleh, now that isn't exactly fair. Oh well, I still haven't quite worked out what benefits voting would have.
Anyhow, I've fiddled with the regexes and the response from delirium still doesn't quite fit in with what everything else tells me. Plugging in the two different RegExs in to the script yields completely different results. And given the examples by anon, it would naturally make sense.