class Regexp

Constants

ALL

OFFSET_CAPTURE

Methods

static array
split(string $subject, string $pattern, int $flags = 0)

Splits string by a regular expression.

static mixed
match(string $subject, string $pattern, int $flags = 0, int $offset = 0)

Performs a regular expression match.

static string
replace(string $subject, string|array $pattern, string|callable $replacement = null)

Perform a regular expression search and replace.

Details

at line 33
static array split(string $subject, string $pattern, int $flags = 0)

Splits string by a regular expression.

Parameters

string $subject
string $pattern
int $flags OFFSET_CAPTURE

Return Value

array

at line 50
static mixed match(string $subject, string $pattern, int $flags = 0, int $offset = 0)

Performs a regular expression match.

Parameters

string $subject
string $pattern
int $flags

OFFSET_CAPTURE, ALL

int $offset

offset in bytes

Return Value

mixed

at line 76
static string replace(string $subject, string|array $pattern, string|callable $replacement = null)

Perform a regular expression search and replace.

Parameters

string $subject
string|array $pattern
string|callable $replacement

Return Value

string

Traits

Better OOP experience.