RSDRegExValidatorObject

public struct RSDRegExValidatorObject : RSDCodableRegExMatchValidator

The RSDRegExValidatorObject is a concrete implementation of the RSDCodableRegExMatchValidator that can be used to create a regex validation of an input string using a regex pattern.

  • A localized custom regular expression that can be used to validate a string.

    Declaration

    Swift

    public let regExPattern: String
  • Default initializer.

    Declaration

    Swift

    public init(regExPattern: String) throws

    Parameters

    regExPattern

    The regular expression pattern.

  • The regExPattern is used to represent the regex.

    Declaration

    Swift

    public var rawValue: String { get }
  • Required initializer for conformance to RawRepresentable. This will return nil if the reg ex is not valid.

    Declaration

    Swift

    public init?(rawValue: String)
  • Required initializer for conformance to Decodable.

    Throws

    DecodingError if the value is not a String or if the regExPattern throws an exception when creating an NSRegularExpression using this pattern.

    Declaration

    Swift

    public init(from decoder: Decoder) throws

    Parameters

    decoder

    The decoder to use to decode this value. This is expected to have a single value container.