title: preg_match doesn't accept new lines
body: <p>I know it sounds a little strange, but I'll try to explain.<br>
  use this code to check if <code>$text</code> contains unsupported characters:</p>
  
  <pre><code>if(!preg_match('/\A[\w .,]+\z/', $text))
  {
      echo "Text contains unsupported characters.";
  }
  </code></pre>
  
  <p>Now the problem is that <code>$text</code> is the text entered by the user in textarea.</p>
  
  <pre><code>$text_c = $_POST['text'];
  $text = mysql_real_escape_string($text_c);
  echo "&lt;form method='post'&gt;&lt;textarea name='text'&gt;".$text."&lt;/textarea&gt;&lt;br /&gt;&lt;input type='submit' name='submit' value='Submit'&gt;&lt;/form&gt;";
  </code></pre>
  
  <p>Everything works perfectly, except one thing. Example, if this is text entered in textarea:</p>
  
  <blockquote>
    <p>Hello, my name is John.</p>
  </blockquote>
  
  <p>OK.</p>
  
  <blockquote>
    <p>Hello, my name is John.<br>
    I am 20 years old.</p>
  </blockquote>
  
  <p>NO. Text contains unsupported characters. (refers to the new line, because content of the textarea change and have something like: <code>My name is John.\r\nI am 20 years old.</code>)</p>
  
  <p>My question is: what I need to change to support new lines? I hope you understand.</p>
  
  <p><strong>EDIT:</strong> I just discovered, without <code>mysql_real_escape_string</code> everything works exactly as I want. Is there any solution to "combine" <code>mysql_real_escape_string</code> with <code>preg_match</code> (in my case) or <code>mysql_real_escape_string</code> supposed to drop?</p>