title: Check whether string has both white spaces or special characters
body: <p>Right now I'm checking whether a string is empty or has white spaces. So far this is my code and it works. </p>
  
  <pre><code>     if(isset($_POST['newTagSubmit'])){
      $tagName = $_POST['tagName'];
      if(empty($tagName)){
          $_ErrorMessage = "&lt;div class='alert alert-danger' id='errorBox'&gt;";
          $_ErrorMessage.= "&lt;b&gt;Error!&lt;/b&gt; Por favor ingrese una etiqueta en el campo de texto proporcionado.";
          $_ErrorMessage.= "&lt;/div&gt;";
      } else {
          if(preg_match('/\s/',$tagName)){
              $_ErrorMessage = "&lt;div class='alert alert-danger' id='errorBox'&gt;";
              $_ErrorMessage.= "&lt;b&gt;Error!&lt;/b&gt; La etiqueta no puede contener espacios. Asegúrese de escribirla correctamente.";
              $_ErrorMessage.= "&lt;/div&gt;";
          } elseif(/*code here*/){
              $_ErrorMessage = "&lt;div class='alert alert-danger' id='errorBox'&gt;";
              $_ErrorMessage.= "&lt;b&gt;Error!&lt;/b&gt; La etiqueta no puede contener carácteres especiales. Cáracteres especiales son todos aquellos que no estan dentro del alfabeto. Por favor escríbala de nuevo.";
              $_ErrorMessage.= "&lt;/div&gt;";
          }
      }
  }
  </code></pre>
  
  <p>The first two if's work, the one where I check if string is empty and the other one is where i check if the string has white spaces.</p>
  
  <p>Now I would like to check if the string has any special characters, but I have no idea how I could form a regex for that scenario. Can anybody help me please. </p>
  
  <p>A little background from this project is, this is where I will be inserting tags for a help desk, the tags can be such words as:</p>
  
  <p>-internet
  -connection
  -wireless
  -router
  -internet-explorer
  -google-chrome
  -firefox</p>
  
  <p>etc.</p>
  
  <p>EDIT:</p>
  
  <p>By special character I mean everything that is outside the alphabet. Only allow A-Z, a-z. </p>