ruby gsub new line characters
<p>I have a string with newline characters that I want to gsub out for white space. </p>

<pre><code>"hello I\r\nam a test\r\n\r\nstring".gsub(/[\\r\\n]/, ' ')
</code></pre>

<p>something like this ^ only my regex seems to be replacing the <code>'r'</code> and <code>'n'</code> letters as well. the other constraint is sometimes the pattern repeats itself twice and thus would be replaced with two whitespaces in a row, although this is not preferable it is better than all the text being cut apart.</p>

<p>If there is a way to only select the new line characters. Or even better if there a more rubiestic way of approaching this outside of going to regex?</p>