title: IF in a Regex expresion? (replace something in file names ONLY if file type is xxx)
body: <p>Ok, I know some regex but this fooling me...</p>
  
  <p>I usually manage every month hundreds of files submited and have to make some checks and replaces before making them available again in our intranet...</p>
  
  <p>I'm doing it locally on hd on Windows, through a file renamer program which can do pcre but only do one line at a time, so all should be in the same regex.</p>
  
  <p>The problem is that I would like to do replacements only if file type is xxx.</p>
  
  <p>For example, replace all spaces for underscores ONLY if extension is jpg|jpeg|jpe</p>
  
  <p>so</p>
  
  <blockquote>
    <p>this is a test.jpg => this_is_a_test.jpg</p>
    
    <p>this is a another test.jpe => this_is_a_another_test.jpe</p>
    
    <p>this is a test.docx => this is a test.docx</p>
  </blockquote>
  
  <p>Jpg is an EXAMPLE, I do diferent replaces for each extension and not for all extensions, so something which replaces spaces in the above example in the .docx will be wrong...</p>
  
  <p>is it posible???</p>