title: Rails 3 + regex - Replace part of a string, 1 occurrence
body: <p>I'm new to Rails, and furthermore to regex. Been looking around, but I'm blocked...  </p>
  
  <p>I have a string like this :  </p>
  
  <p>Current: <code>http://zs.domain.com/user_images/123456789/imageName_size.ext</code></p>
  
  <p>Wanted: <code>http://zs.domain.com/user_images/123456789/imageName.ext</code></p>
  
  <p>I've managed to get to this :<br>
  <a href="http://a0.twimg.com/profile/1240267050/logo1.png" rel="nofollow">http://a0.twimg.com/profile/1240267050/logo1.png</a><br>
  => losing all occurrences with</p>
  
  <pre><code>picture.gsub!(/_([a-z0-9-]+)/, '')
  </code></pre>
  
  <p>or this :</p>
  
  <p><a href="http://a0.twimg.com/profile_images/1240267050/logo1" rel="nofollow">http://a0.twimg.com/profile_images/1240267050/logo1</a><br>
  => changing only the last occurrence, but losing the extension with</p>
  
  <pre><code>picture.gsub!(/_([a-z0-9-]+)**.(png|gif|jpg|jpeg)**/, '')  
  </code></pre>