title: Regex (C#): Replace \n with \r\n
body: <p>How can I replace lone instances of \n with \r\n (LF alone with CRLF) using a regular expression in C#?</p>
  <p>I know to do it using plan <code>String.Replace</code>, like:</p>
  <pre><code>myStr.Replace(&quot;\n&quot;, &quot;\r\n&quot;);
  myStr.Replace(&quot;\r\r\n&quot;, &quot;\r\n&quot;);
  </code></pre>
  <p>However, this is inelegant, and would destroy any &quot;\r+\r\n&quot; already in the text (although they are not likely to exist).</p>