Wikibase
MediaWiki Wikibase extension
Loading...
Searching...
No Matches
Wikibase\Repo\Validators\RegexValidator Class Reference

RegexValidator checks a string against a regular expression. More...

+ Inheritance diagram for Wikibase\Repo\Validators\RegexValidator:
+ Collaboration diagram for Wikibase\Repo\Validators\RegexValidator:

Public Member Functions

 __construct ( $expression, $inverse=false, $errorCode='malformed-value')
 
 validate ( $value)
 
 setOptions (array $options)
 

Private Attributes

 $expression
 
 $inverse
 
 $errorCode
 

Detailed Description

RegexValidator checks a string against a regular expression.

Author
Daniel Kinzler

Constructor & Destructor Documentation

◆ __construct()

Wikibase\Repo\Validators\RegexValidator::__construct ( $expression,
$inverse = false,
$errorCode = 'malformed-value' )
Parameters
string$expression
bool$inverse
string$errorCodecode to use when this validator fails.

Member Function Documentation

◆ setOptions()

Wikibase\Repo\Validators\RegexValidator::setOptions ( array $options)
See also
ValueValidator::setOptions()
Parameters
array$options

◆ validate()

Wikibase\Repo\Validators\RegexValidator::validate ( $value)
See also
ValueValidator::validate()
Parameters
string$valueThe value to validate
Returns
Result

Member Data Documentation

◆ $errorCode

Wikibase\Repo\Validators\RegexValidator::$errorCode
private

◆ $expression

Wikibase\Repo\Validators\RegexValidator::$expression
private

◆ $inverse

Wikibase\Repo\Validators\RegexValidator::$inverse
private

The documentation for this class was generated from the following file: