title: How can I remove all non-word characters except the newline?
body: <p>I have a file like this:</p>
  
  <pre><code>my line - some words &amp; text
  oh lóok i've got some characters
  </code></pre>
  
  <p>I want to 'normalize' it and remove all the non-word characters. I want to end up with something like this:</p>
  
  <pre><code>mylinesomewordstext
  ohlóokivegotsomecharacters
  </code></pre>
  
  <p>I'm using Linux on the command line at the moment, and I'm hoping there's some one-liner I can use.</p>
  
  <p>I tried this:</p>
  
  <pre><code>cat file | perl -pe 's/\W//'
  </code></pre>
  
  <p>But that removed all the newlines and put everything one line. Is there someway I can tell Perl to not include newlines in the <code>\W</code>? Or is there some other way?</p>