RegexRule

open class RegexRule : RuleType

RegexRule presents a regex that a text field value should follow.

Version

1.8.0

Date

08/10/21

Author

Adamas
  • Initialize the rule

    Declaration

    Swift

    public init(regex: String, message: String)

    Parameters

    regex

    The regex expression.

    message

    The error message to apply.

  • Initialize the rule

    Declaration

    Swift

    public init(regexes: [String], message: String)

    Parameters

    regexes

    A list of regexes. The rule will pass if any of them is matched.

    message

    The error message to apply.

  • Declaration

    Swift

    public func isValid(value: String?) -> String?