Constructor
new RegExpValidator(options)
Parameters:
Name | Type | Description |
---|---|---|
options |
Object | an object literal used to provide the pattern, an optional hint and error
message.
|
- Source:
- ojvalidation/RegExpValidator.js, line 41
Methods
-
getHint() → {String|null}
-
A message to be used as hint, when giving a hint on the expected pattern. There is no default hint for this property.
- Source:
- ojvalidation/RegExpValidator.js, line 120
Returns:
a hint message or null if no hint is available in the options- Type
- String | null
-
Init(options)
-
Initializes validator instance with the set options
Parameters:
Name Type Description options
Object - Source:
- ojvalidation/RegExpValidator.js, line 58
-
validate(value) → {boolean}
-
Validates value for matches using the regular expression provided by the pattern.
Parameters:
Name Type Description value
string | number that is being validated - Source:
- ojvalidation/RegExpValidator.js, line 74
Throws:
when there is no match- Type
- Error
Returns:
true if validation was successful- Type
- boolean