SFormTextFieldRegexValidator Class Reference

Inherits from NSObject
Conforms to SFormTextFieldValidator
Declared in SFormTextFieldRegexValidator.h
Availability
Related samples

Overview

A validator to check a text field’s text against a regular expression.

Properties

invalidMessage

A string representing the invalid message to provide.

@property (nonatomic, strong) NSString *invalidMessage

Declared In

SFormTextFieldRegexValidator.h

regexString

The regex string the validator will validate against.

@property (nonatomic, strong, readonly) NSString *regexString

Declared In

SFormTextFieldRegexValidator.h

Instance Methods

initWithRegexString:

Create the validator to verify using a regex string.

- (instancetype)initWithRegexString:(NSString *)regexString

Discussion

By default, this will match againt partial strings. To specify that the entire string must match the regex, use the ^ (beginning of line) and $ (end of line) characters at either end of the string.

Declared In

SFormTextFieldRegexValidator.h

initWithRegularExpression:

Create the validator to verify using an NSRegularExpression.

- (instancetype)initWithRegularExpression:(NSRegularExpression *)regularExpression

Declared In

SFormTextFieldRegexValidator.h