final class Regex implements Type, RegexInterface, Serializable, JsonSerializable (View source)

Class Regex

Methods

__construct(string $pattern, string $flags = '')

Construct a new Regex

string
getFlags()

Returns the Regex's flags

string
getPattern()

Returns the Regex's pattern

string
__toString()

Returns the string representation of this Regex

static 
__set_state(array $properties)

No description

string|null
serialize()

Serialize a Regex

void
unserialize(string $data)

Unserialize a Regex

mixed
jsonSerialize()

Returns a representation that can be converted to JSON

Details

final __construct(string $pattern, string $flags = '')

Construct a new Regex

Parameters

string $pattern
string $flags

final string getFlags()

Returns the Regex's flags

Return Value

string

Returns the RegexInterface's flags.

final string getPattern()

Returns the Regex's pattern

Return Value

string

Returns the RegexInterface's pattern.

final string __toString()

Returns the string representation of this Regex

Return Value

string

static __set_state(array $properties)

No description

Parameters

array $properties

final string|null serialize()

Since: 1.2.0

Serialize a Regex

Return Value

string|null

The string representation of the object or null

Exceptions

InvalidArgumentException

final void unserialize(string $data)

Since: 1.2.0

Unserialize a Regex

Parameters

string $data

The string representation of the object.

Return Value

void

Exceptions

InvalidArgumentException
UnexpectedValueException

final mixed jsonSerialize()

Since: 1.2.0

Returns a representation that can be converted to JSON

Return Value

mixed

data which can be serialized by json_encode, which is a value of any type other than a resource.

Exceptions

InvalidArgumentException