code: public Constraint regexp(String regexp, String type) {
          RegexpConstraint c = new RegexpConstraint(regexp);
          c.setType(type);
          return c;
      }
docs: Creates a constraint backed by a regular expression, with a type for
  reporting.
  
  @param regexp The regular expression string.
  @return The constraint.