title: Regex - match a string without leading and trailing spaces
body: <p>Building an expression that will reject an untrimmed input string.</p>
  
  <p>Have a group of white-listed symbols, including <em>whitespace</em>. But it cannot be used at the first or at the last one position. However, it may be used between any leading and trimming white-listed symbol in any amount.</p>
  
  <p>Have a following expression:</p>
  
  <pre><code>^[^\s][A-Za-z0-9\s]*[^\s]$
  </code></pre>
  
  <p>... but it doesn't work in several reasons, at least it still matches at leading and trailing position any non-whitespace symbol even if it's not white-listed. Futhermore, it won't match single letter word even if it matches to the expression.</p>
  
  <p>The whitelist is A-Z, a-z, 0-9, whitespace.</p>
  
  <p>Valid case:</p>
  
  <pre><code>Abc132 3sdfas // everything ok
  </code></pre>
  
  <p>Invalid case #1:</p>
  
  <pre><code> asd dsadas // leading\trailing space is exist
  </code></pre>
  
  <p>Invalid case #2:</p>
  
  <pre><code>$das dsfds // not whitelisted symbol at the leading\trailing position
  </code></pre>
  
  <p>So, how to add a whitespace symbol to the white-list if it isn't the leading or the trailing symbol?</p>