title: Remove parentheses in powershell regex?
body: <p>I cant find a find an answer that is clear to me. I am changing a bunch of image file names in a directory, when I rename them they all get renamed to <code>image (1).png</code> <code>image (2).png</code> for as many images as I have then I run this in power shell.</p>
  
  <pre><code>Dir | Rename-Item –NewName { $_.name –replace " ","_" }
  </code></pre>
  
  <p>This finds the space and renames it to <code>image_(1).png</code> <code>image_(2).png</code> nice and easy, but It becomes a headache trying to replace the parentheses. I am trying to get rid of them to look like this <code>image_1.png</code> <code>image_2.png</code> but it's gotten really frustrating finding an answer lol.</p>
  
  <p>I wish I could just write.</p>
  
  <pre><code>Dir | Rename-Item –NewName { $_.name –replace "\(*\)","*" } 
  </code></pre>
  
  <p>or</p>
  
  <pre><code>Dir | Rename-Item –NewName { $_.name –replace "\([1-10]\)","[1-10]" }
  </code></pre>
  
  <p>or</p>
  
  <pre><code>Dir | Rename-Item –NewName { $_.name –replace "\(\W\)","\W" }
  </code></pre>
  
  <p>I tried them all and you would think that syntax is valid, but nope :( So I am hoping for  a little nudge in the right direction.</p>