Make a regex matcher for alphanumerics and replace anything that doesn't match with an underscore. That'll work.
Alhifar, you're better with that sort of thing that anyone else I know. Do you want to knock out some quicky code for that? I'm pretty sure that dj_d once said he's not good with matchers and it takes me a little while (and a bit of trial-and-error) to get that sort of code just right.