This commit is contained in:
Suresh, Kamlesh 2020-03-10 11:37:08 -04:00
parent f8589aabfc
commit c1047d42b8

View File

@ -12,8 +12,12 @@ public class RuleRegexModel: RulesProtocol {
public static var identifier: String = "regex"
public var type: String = RuleRegexModel.identifier
public var fields: [String]
public var regex: String
public func isValid(_ formField: FormFieldProtocol) -> Bool {
if let stringToValidate = formField.formFieldValue() as? String {
return MVMCoreUIUtility.validate(stringToValidate, withRegularExpression: regex)
}
return false
}
}