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|null $replacement = null)

Perform a regular expression search and replace.

Details

at line 25
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 41
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

Return Value

mixed

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

Perform a regular expression search and replace.

Parameters

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

Return Value

string

Traits

Better OOP experience.