title: How to restrict white-space at only begin?
body: <p>I have written the regex pattern for restricting white space at the start but it is not working. Guide me in finding where I need to change the logic?</p>
  
  <pre><code>^[^\s]+[a-z-A-Z]$
  </code></pre>
  
  <p>I need to do this in java-script to validate the input field. I need to allow all character in the input field without white space at start and I need all white space at the end and intermediate.</p>