title: PHP validation for matching multiple lines using preg_match()
body: <p>I have the following code snippet where I want to match supplied input by the user to match any input other that specified in the regular expression. Everything is working fine but \n part, where I want to allow multiple line. And this in particular is not working.</p>
  
  <pre><code>if(preg_match("/[^A-Za-z0-9., \/-\n]/", $addr))
      {
      echo "Invalid user input  ";
      exit;
      }
  </code></pre>
  
  <p>I am getting the message</p>
  
  <pre><code>Warning: preg_match() [function.preg-match]: Compilation failed: range out of order in character class at offset 17 in ......
  </code></pre>
  
  <p>Friends tell me how to allow multiple lines here.</p>