code: func Pattern(p string) {
  	if a, ok := attributeDefinition(); ok {
  		if a.Type != nil && a.Type.Kind() != design.StringKind {
  			incompatibleAttributeType("pattern", a.Type.Name(), "a string")
  		} else {
  			_, err := regexp.Compile(p)
  			if err != nil {
  				dslengine.ReportError("invalid pattern %#v, %s", p, err)
  			} else {
  				if a.Validation == nil {
  					a.Validation = &dslengine.ValidationDefinition{}
  				}
  				a.Validation.Pattern = p
  			}
  		}
  	}
  }
docs: // Pattern can be used in: Attribute, Header, Param, HashOf, ArrayOf
  //
  // Pattern adds a "pattern" validation to the attribute.
  // See http://json-schema.org/latest/json-schema-validation.html#anchor33.