title: preg_match does not work
body: <p>This script checks if there is a special character or not, if there is, it calls for the preg match's "Invalid" function, else it says username available. What happens here is that every time I write a special character like #@%^&amp; it still says username available instead of saying invalid, and that's not how it's supposed to work. I have checked the PHP code for errors and it seemed to be clean. I have tried and run to everything on forums and couldn't find a solution. Your contribution will be so much appreciated!</p>
  
  <pre><code>if(isset($_POST['login'])) {
      $login = mysql_real_escape_string($_POST['login']);
  
      if(!empty($login)) {
  
          $login_query = mysql_query("SELECT COUNT(`id`) FROM `account` WHERE `login` = '$login'");
          $login_result = mysql_result($login_query,0);
  
          if($login_result == 0) {
             echo 'yes';
          } else {
             echo 'no';
          } 
      } 
   }
  
   if ( preg_match("/^[a-zA-Z0-9[:space:]]+$/" , $login) )  {
      echo 'noinput'; 
   }
  </code></pre>
  
  <p>P.S I am not some kid who has leeched a code from the internet and is trying to get the others to do the work for him, I have written like 70% of this script and it works pretty well except the special characters thingy which I'm so stuck with. I hope you can help me. Thank you!</p>