title: Is there an equivalent in jQuery to PHP's `preg_replace()`?
body: <p>Say I have the following:</p>
  
  <pre><code>&lt;img src="http://www.site.com/folder/pic.jpg"&gt;
  </code></pre>
  
  <p>This path could be anything, we basically want to get the "pic.jpg as a variable.</p>
  
  <p>Currently we are doing it like so:</p>
  
  <pre><code>var first_img = $("#thumbnail-area li:first").find("img").attr("title");
  </code></pre>
  
  <p>Which sets the <code>first_img</code> variable as the image src, but we want to do a preg match kinda thing like in PHP to grab the "pic.jpg".</p>
  
  <p>This has to work properly, so the path could be: <code>folder/foo/bar/x982j/second822.jpg</code> and it'd return <code>second822.jpg</code></p>
  
  <p>How can I do this?</p>