Overview

Namespaces

  • None
  • Wei
    • Validator

Classes

  • All
  • AllOf
  • Alnum
  • Alpha
  • BaseValidator
  • Between
  • Blank
  • Callback
  • CharLength
  • Chinese
  • Color
  • Contains
  • CreditCard
  • Date
  • DateTime
  • Decimal
  • Digit
  • Dir
  • DivisibleBy
  • DoubleByte
  • Email
  • EndsWith
  • EqualTo
  • Exists
  • FieldExists
  • File
  • GreaterThan
  • GreaterThanOrEqual
  • IdCardCn
  • IdCardHk
  • IdCardMo
  • IdCardTw
  • IdenticalTo
  • Image
  • In
  • Ip
  • Length
  • LessThan
  • LessThanOrEqual
  • Lowercase
  • Luhn
  • MaxLength
  • MinLength
  • MobileCn
  • NaturalNumber
  • NoneOf
  • Null
  • Number
  • OneOf
  • Password
  • Phone
  • PhoneCn
  • PlateNumberCn
  • PositiveInteger
  • PostcodeCn
  • Present
  • QQ
  • RecordExists
  • Regex
  • Required
  • SomeOf
  • StartsWith
  • Time
  • Tld
  • Type
  • Uppercase
  • Url
  • Uuid
  • Overview
  • Namespace
  • Class

Class Regex

Check if the input is valid by specified regular expression

Wei\Base
Extended by Wei\Validator\BaseValidator
Extended by Wei\Validator\Regex

Direct known subclasses

Wei\Validator\Alnum, Wei\Validator\Alpha, Wei\Validator\PlateNumberCn, Wei\Validator\PostcodeCn, Wei\Validator\QQ, Wei\Validator\Uuid, Wei\Validator\Chinese, Wei\Validator\Color, Wei\Validator\Digit, Wei\Validator\DoubleByte, Wei\Validator\IdCardMo, Wei\Validator\MobileCn, Wei\Validator\Phone, Wei\Validator\PhoneCn
Namespace: Wei\Validator
Author: Twin Huang twinhuang@qq.com
Located at Validator/Regex.php
Methods summary
public boolean
# __invoke( mixed $input, null|string $pattern = null )

Returns whether the $input value is valid

Returns whether the $input value is valid

Parameters

$input
$pattern

Returns

boolean

Overrides

Wei\Validator\BaseValidator::__invoke()
protected boolean
# doValidate( mixed $input )

Validate the input value (ignore the $negative property)

Validate the input value (ignore the $negative property)

Parameters

$input
The input to be validated

Returns

boolean
Methods inherited from Wei\Validator\BaseValidator
addError(), getErrors(), getFirstMessage(), getJoinedMessage(), getMessages(), getName(), hasError(), isString(), isValid(), loadTranslationMessages(), setMessages(), setName(), storeOption()
Methods inherited from Wei\Base
__call(), __construct(), __get(), getOption(), setOption()
Magic methods inherited from Wei\Validator\BaseValidator
t()
Properties summary
protected string $patternMessage
# '%name% must match against pattern "%pattern%"'
protected string $negativeMessage

The common message for negative validator

The common message for negative validator

# '%name% must not match against pattern "%pattern%"'
protected string $pattern

The regex pattern

The regex pattern

#
Properties inherited from Wei\Validator\BaseValidator
$errors, $name, $negative, $notStringMessage, $validator
Properties inherited from Wei\Base
$providers, $wei
Magic properties inherited from Wei\Validator\BaseValidator
$t
Wei Framework API documentation generated by ApiGen