code: function makeValidation(name, exp, parser) {
      return function (input) {
          if (typeof input !== 'string') {
              throw new TypeError('Cannot validate ' + name + '. Input must be a string.');
          }
          var validate = function () {
              return input.match(exp) ? true : false;
          };
          return {
              valid: validate(),
              parse: function () {
                  if (!validate()) {
                      return false;
                  }
                  var captures = exp.exec(input);
                  return parser(captures);
              }
          };
      };
  }
docs: this makes a validation function for a string type defined by 'name'