title: Regex that allows only one space in the first/last name validation
body: <p>I'm trying to write a regular expression to remove white spaces from just the beginning of the word, not after, and only a single space after the word.</p>
  
  <p>Used RegExp:</p>
  
  <pre><code>var re = new RegExp(/^([a-zA-Z0-9]+\s?)*$/);
  </code></pre>
  
  <p>Test Exapmle:</p>
  
  <pre><code>1) test[space]ing - Should be allowed 
  2) testing - Should be allowed 
  3) [space]testing - Should be allowed but have to trim the space at the first
  4) testing[space] - Should be allowed but have to trim the space at the last 
  5) testing[space][space] - should be allowed but have to trim the space at the last  
  6) test[space][space]ing - one space should be allowed but the remaining spaces have to be trimmed.
  </code></pre>
  
  <p>Any idea how this can be achieved using regex? </p>
  
  <p><strong>EDIT:</strong> </p>
  
  <p>I have this,</p>
  
  <pre><code> var regExp = /^(\w+\s?)*\s*$/;
  if(regExp.test($('#FirstName').val())){
                      $('#FirstName').val().replace(/\s+$/, '');
                  }else{
                      var elm = $('#FirstName'),
                      msg = 'First Name must consist of letters with no spaces';
                      return false;
                  }
  </code></pre>