title: RegExpr to insert space before \n
body: <p>I'm need to insert space before new-line-symbol if it's not yet. For ex, in the text like this:</p>
  
  <pre><code>Some text 
  need space dfgfgfkgkf
  </code></pre>
  
  <p>insert space between 'text' and 'need'..</p>
  
  <pre><code>$pattern = "/[^\s]\n/i";
  $replace = " \n";
  </code></pre>
  
  <p>but this regexp don't work</p>