function validateUsername(username, failureCallback) {
    if (usernameRegex.test(username) && checkLength(username, 4, 80)) {
      return true;
    } else {
      if (failureCallback && typeof(failureCallback) === "function") {
        failureCallback(this.getUsernameAllowedChars());
      }
      return false;
    }
  }
/**
    * Tests the string against the allowed chars regex
    *
    * @public
    * @method validateUsername
    * @param {string} username - The string to test
    * @param {function} failureCallback - (optional), the function to call on a failure
    * @return {boolean} Returns true if string passes regex, false if not
    */
Tests the string against the allowed chars regex


Tests the string against the allowed chars regex
function validateUsername(username, failureCallback) {
    if (usernameRegex.test(username) && checkLength(username, 4, 80)) {
      return true;
    } else {
      if (failureCallback && typeof(failureCallback) === "function") {
        failureCallback(this.getUsernameAllowedChars());
      }
      return false;
    }
  }
function validateUsername ( username , failureCallback ) { if ( usernameRegex . test ( username ) && checkLength ( username , 4 , 80 ) ) { return true ; } else { if ( failureCallback && typeof ( failureCallback ) === "function" ) { failureCallback ( this . getUsernameAllowedChars ( ) ) ; } return false ; } }
Tests the string against the allowed chars regex
Tests the string against the allowed chars regex