title: Reg ex with . and space
body: <p>I am having problem with regular expression. When ever I type 'St. Joe', the input is stored on the backend as 'St.' only. I have a space in my regular expression, but i am not sure what is wrong. </p>
  
  <p>Here's the function the input goes through. </p>
  
  <pre><code>function reg_sent($i){
      $reg_sent = "/[^A-Za-z0-9., '\n\r ]/";
      return preg_replace($reg_sent, '', $i);
  }
  </code></pre>