title: Using regex to parse line breaks and dollar signs in scraped image src using Nokogiri
body: <p>I am using nokogiri in my rails 4 app to scrape images from websites and some of them give me unexpected '$' after '' errors.</p>
  
  <p>For instance, here is one sample image url output:</p>
  
  <pre><code>  &lt;img src="http://x.example.com/images/detail/ln9502/1_ln-9502---
  
    grh_375.jpg" alt="" style="display: block;"&gt;
  </code></pre>
  
  <p>I suspect it is the line break that is giving me trouble?</p>
  
  <p>Here is another:</p>
  
  <pre><code>  &lt;img class="abc" src="http://xxx.example.com/is/image/Sample/503508739_1?$sample_size$"&gt;
  </code></pre>
  
  <p>I suspect it is the dollar signs giving me issues here.</p>
  
  <p>Here is what I have in one of my controllers that is saving the image:</p>
  
  <pre><code>  item_imageurl = page.search(library.image_selector).first.attribute('src').value(/(.|\n|\r)*/).to_s
  </code></pre>
  
  <p>Where I have items that belong to a library and I set the css selector in each library.  Any ideas on what regex I could use to ignore line breaks and dollar signs, unless there's a simpler solution?</p>