title: How do I do an xpath regex search in my Cucumber / Capybara step definition (Rails 3)?
body: <p>I have a Scenario that validates that the image I just uploaded exists on the next page.</p>
  
  <p>This below works great, except that I have a variable folder structure based on the listing_id. How can I use regex here to match <strong>image</strong> to only the filename instead of the entire url?</p>
  
  <pre><code>Then /^I should see the image "(.+)"$/ do |image|
      page.should have_xpath("//img[@src=\"/public/images/#{image}\"]")
  end
  </code></pre>