title: Python: How to match special characters in regular expression?
body: <p>I'm trying to do a regular expression match with special characters in it, such as "/", ".", and "-". 
  This is the string:</p>
  
  <pre><code>17440 root      20   0 3645m 452m  12m S  152 11.8 347:32.04 test/1/02.3_4-6 
  </code></pre>
  
  <p>But the following code does not seem to match at the end with :</p>
  
  <pre><code>m=re.search(r"(?P&lt;pid&gt;\d+) +(?P&lt;user&gt;\w+) +(?P&lt;pr&gt;[\w-]+) +(?P&lt;ni&gt;[\w-]+) +(?P&lt;virt&gt;\w+) +(?P&lt;res&gt;\w+) +(?P&lt;shr&gt;\w+) +(?P&lt;st&gt;\w) +(?P&lt;cpu&gt;\d+) +(?P&lt;mem&gt;\d.+) +(?P&lt;time&gt;[0-9:.]+) +(?P&lt;proc_name&gt;[\w-/.]+)", line)
  </code></pre>
  
  <p>Do I need backslash before the special characters, such as "/" and "."? 
  Thanks!</p>