title: How to rermove non-alphanumeric characters at the beginning or end of a string
body: <p>I have a list with elements that have unnecessary (non-alphanumeric) characters at the beginning or end of each string.</p>
  
  <p>Ex.</p>
  
  <pre><code>'cats--'
  </code></pre>
  
  <p>I want to get rid of the --</p>
  
  <p>I tried:</p>
  
  <pre><code>for i in thelist:
      newlist.append(i.strip('\W'))
  </code></pre>
  
  <p>That didn't work. Any suggestions.</p>