diff --git a/MVMCoreUI/FormUIHelpers/New/Rules/RuleRegexModel.swift b/MVMCoreUI/FormUIHelpers/New/Rules/RuleRegexModel.swift index bc66fd1a..db1c4859 100644 --- a/MVMCoreUI/FormUIHelpers/New/Rules/RuleRegexModel.swift +++ b/MVMCoreUI/FormUIHelpers/New/Rules/RuleRegexModel.swift @@ -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 } }