Inherits from MMTextFieldValidator : NSObject
Declared in MMRegexTextFieldValidator.h
MMRegexTextFieldValidator.m

Overview

  • A concrete validator that checks to see if the contents

  • of the text field matches a given regular expression.

Properties

regex

  • A string represention of a regular expression that
@property (nonatomic, strong) NSString *regex

Discussion

  • is to be used to validate the contents of a text field.

Declared In

MMRegexTextFieldValidator.h

Instance Methods

initWithTextField:withRegexString:withValidationMessage:

  • A constructor that accepts a text field to validate, a regular expression string,
- (id)initWithTextField:(UITextField *)textField withRegexString:(NSString *)regex withValidationMessage:(NSString *)errorMessage

Discussion

  • and the corresponding validation message.

*

  • @param textField The text field to be validated.

  • @param regex The regular expression that is to be used to validate the text field.

  • @param errorMessage The validation message to be shown if text field contents are invalid.

*

Declared In

MMRegexTextFieldValidator.h

isValid

- (BOOL)isValid

Declared In

MMValidatorProtocol.h