title: Square brackets in php preg_match
body: <p>I would like to in form I can enter only the letters of the alphabet, numbers, and square brackets, except for special characters. Whether the brackets to include special characters? I have such:</p>
  
  <pre><code>if (preg_match("/[^a-zA-Z0-9]+/", $characters))
  {
      echo "Write only letters of alphabet and numbers!";
  }
  </code></pre>
  
  <p>It detects letters and numbers correctly, does not pass the special characters but how to do that I can also enter the square brackets? </p>