title: Regular expression for LastName, FirstName with space
body: <p>I am using the below JS to enter name in LastName, FirstName format like this <code>Clark, Michael</code> and now I also probably need to allow names like this <code>Tim Duncan, Vince Carter</code> where these kinda names have space in between.</p>
  
  <pre><code>function validateName(txtbox) {
          var name = /^\w{1,20}\, \w{1,20}$/
          var check = document.getElementById(txtbox);
          if (check != null) {
              if (check.value != "") {
                  if (!name.test(check.value)) {
                      alert('Please enter name in Last Name, First Name format');
                      document.getElementById(txtbox).focus();
                      return false;
                  }
                  else {
                      return true;
                  }
              }
              else if (name.test(check.value)) {
                  return true;
              }
              else if (check.value == "") {
                  return true;
              }
          }
      }
  </code></pre>
  
  <p>Is there any way to achieve this by a change within the same Regex. Really appreciate suggestions and help.</p>