This is the regex I use to convert a free text value to a filename style value (used in my CMS to create a filename based on a page title):
string cleanName = new Regex(“\W”).Replace(uncleanName, “”)
e.g: new Regex(“\W”).Replace(“page & title $ with %bad characters!!”, “”) = “pagetitlewithbadcharacters”