RegexConstraint

public struct RegexConstraint : Constraint

A constraint to validate if a value is a regular expression.

  • A default error message to show if no custom error message is provided.

    Declaration

    Swift

    public static let message: String
  • A custom error message.

    Declaration

    Swift

    public let message: String
  • See Constraint.

    Declaration

    Swift

    public let groups: Set<Group>
  • A validator named RegexValidator to validate a value.

    Declaration

    Swift

    public let validator: ConstraintValidator
  • Initializes a new instance with a custom error message and a set of Groups to group by.

    Declaration

    Swift

    public init(_ message: String = message, groups: Set<Group> = .init())

    Parameters

    message

    A custom error message. Defaults to the default error message.

    groups

    A set of Groups to group by. Defaults to an empty set.