title: Remove Punctuation and Spaces from string using Regex
body: <p>I am trying to take out all the punctuation and spaces in a string that I am going to encrypt using a Playfair Cipher. I can't figure out why this line doesn't work.    </p>
  
  <pre><code>s = Regex.Replace(s, @"[^\w\s]", string.Empty);
  </code></pre>