RSDRegExMatchValidator

public protocol RSDRegExMatchValidator : RSDTextValidator

Undocumented

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

    Throws

    Error if the regular expression cannot be instantiated.

    Declaration

    Swift

    func regularExpression() throws -> NSRegularExpression

    Return Value

    The regular expression to use in validation.

  • regExMatches(_:) Extension method

    Method for evaluating a string against the validationRegex for a match.

  • paramater string: The string to evaluate.
  • Throws

    If the regular expression cannot be created.

    Declaration

    Swift

    public func regExMatches(_ string: String) throws -> Int

    Return Value

    The number of matches found.

  • isValid(_:) Extension method

    Test the string against the validation regular expression and return true if there is one or more matches to the given string.

  • paramater string: The string to evaluate.
  • Throws

    If the regular expression cannot be created.

    Declaration

    Swift

    public func isValid(_ string: String) throws -> Bool

    Return Value

    Whether or not the string is valid.