title: How do I remove carriage returns with Ruby?
body: <p>I thought this code would work, but the regular expression doesn't ever match the \r\n. I have viewed the data I am reading in a hex editor and verified there really is a hex D and hex A pattern in the file.</p>
  
  <p>I have also tried the regular expressions /\xD\xA/m and /\x0D\x0A/m but they also didn't match.</p>
  
  <p>This is my code right now:</p>
  
  <pre><code>   lines2 = lines.gsub( /\r\n/m, "\n" )
     if ( lines == lines2 )
         print "still the same\n"
     else
         print "made the change\n"
     end
  </code></pre>
  
  <p>In addition to alternatives, it would be nice to know what I'm doing wrong (to facilitate some learning on my part).  :)</p>