title: String manipulation in jquery using regex
body: <p>I want to extract the url to download a file when user clicks on the image. the url of the image contains the url of the document as <code>/Image/_Z_/Catalog_doc.jpg</code></p>
  
  <p>Then user clicks I call a jQuery function <code>fetchAndOpen(this)</code></p>
  
  <p>In this method I would like to build proper file url i.e. : <code>/Docs/Catalog.doc</code></p>
  
  <p>So basically my issue is image extension (.jpg or .png or any other) second thing I want to remove <code>/_Z_/</code> (this is hard coded predefined) and the last thing I want to replace <code>_</code> with <code>.</code> with the document extension.</p>
  
  <p>Is there any regex or some simple solution of jQuery that can help me i know this can be easily done in javascript with <code>substring</code> and <code>lastIndexOf</code> methods but i expecting some thing with jquery / regex or other jquery based way out.</p>
  
  <p><br>
  INPUT: /Image/<em>Z</em>/Catalog_doc.jpg -> OUTPUT: /Docs/Catalog.doc
  <br></p>
  
  <p>Thanks.</p>