code: function() {
        var val = this.getValue();
  
        // empty field
        if (val === '') {
           // validate only if not required
           return !this.options.required;
        }
  
        // Check regex matching and minLength (both used in password field...)
        var result = true;
  
        // if we are using a regular expression
        if( this.options.regexp ) {
  	      result = result && val.match(this.options.regexp);
        }
        if( this.options.minLength ) {
  	      result = result && val.length >= this.options.minLength;
        }
        return result;
     }
docs: Uses the optional regexp to validate the field value