I would be doing:
string url = title;
url = Regex.Replace(url, @"^\W+|\W+$", "");
url = Regex.Replace(url, @"'\"", "");
url = Regex.Replace(url, @"_", "-");
url = Regex.Replace(url, @"\W+", "-");
Basically what this is doing is it:
- strips non-word characters from the beginning and end of the title;
- removes single and double quotes (mainly to get rid of apostrophes in the middle of words);
- replaces underscores with hyphens (underscores are technically a word character along with digits and letters); and
- replaces all groups of non-word characters with a single hyphen.