title: Regex to accept only alphabets and spaces and disallowing spaces at the beginning and the end of the string
body: <p>I have the following requirements for validating an input field:</p>
  
  <ol>
  <li>It should only contain alphabets and spaces between the alphabets.</li>
  <li>It cannot contain spaces at the beginning or end of the string.</li>
  <li>It cannot contain any other special character.</li>
  </ol>
  
  <p>I am using following regex for this: </p>
  
  <pre><code>^(?!\s*$)[-a-zA-Z ]*$
  </code></pre>
  
  <p>But this is allowing spaces at the beginning. Any help is appreciated.</p>