Documentation

Regex
in package

Table of Contents

Methods

isMatch()  : bool
match()  : MatchResult
matchAll()  : MatchAllResult
matchAllStrictGroups()  : MatchAllStrictGroupsResult
Variant of `matchAll()` which returns non-null matches (or throws)
matchAllWithOffsets()  : MatchAllWithOffsetsResult
Runs preg_match_all with PREG_OFFSET_CAPTURE
matchStrictGroups()  : MatchStrictGroupsResult
Variant of `match()` which returns non-null matches (or throws)
matchWithOffsets()  : MatchWithOffsetsResult
Runs preg_match with PREG_OFFSET_CAPTURE
replace()  : ReplaceResult
replaceCallback()  : ReplaceResult
replaceCallbackArray()  : ReplaceResult
replaceCallbackStrictGroups()  : ReplaceResult
Variant of `replaceCallback()` which outputs non-null matches (or throws)
checkOffsetCapture()  : void
checkSetOrder()  : void

Methods

isMatch()

public static isMatch(non-empty-string $pattern, string $subject[, int $offset = 0 ]) : bool
Parameters
$pattern : non-empty-string
$subject : string
$offset : int = 0
Return values
bool

match()

public static match(non-empty-string $pattern, string $subject[, int $flags = 0 ][, int $offset = 0 ]) : MatchResult
Parameters
$pattern : non-empty-string
$subject : string
$flags : int = 0
$offset : int = 0
Return values
MatchResult

matchAll()

public static matchAll(non-empty-string $pattern, string $subject[, int $flags = 0 ][, int $offset = 0 ]) : MatchAllResult
Parameters
$pattern : non-empty-string
$subject : string
$flags : int = 0
$offset : int = 0
Return values
MatchAllResult

matchAllWithOffsets()

Runs preg_match_all with PREG_OFFSET_CAPTURE

public static matchAllWithOffsets(non-empty-string $pattern, string $subject[, int $flags = 0 ][, int $offset = 0 ]) : MatchAllWithOffsetsResult
Parameters
$pattern : non-empty-string
$subject : string
$flags : int = 0
$offset : int = 0
Return values
MatchAllWithOffsetsResult

matchStrictGroups()

Variant of `match()` which returns non-null matches (or throws)

public static matchStrictGroups(non-empty-string $pattern, string $subject[, int $flags = 0 ][, int $offset = 0 ]) : MatchStrictGroupsResult
Parameters
$pattern : non-empty-string
$subject : string
$flags : int = 0
$offset : int = 0
Tags
throws
UnexpectedNullMatchException
Return values
MatchStrictGroupsResult

matchWithOffsets()

Runs preg_match with PREG_OFFSET_CAPTURE

public static matchWithOffsets(non-empty-string $pattern, string $subject[, int $flags = 0 ][, int $offset = 0 ]) : MatchWithOffsetsResult
Parameters
$pattern : non-empty-string
$subject : string
$flags : int = 0
$offset : int = 0
Return values
MatchWithOffsetsResult

replace()

public static replace(string|array<string|int, string> $pattern, string|array<string|int, string> $replacement, string $subject[, int $limit = -1 ]) : ReplaceResult
Parameters
$pattern : string|array<string|int, string>
$replacement : string|array<string|int, string>
$subject : string
$limit : int = -1
Return values
ReplaceResult

replaceCallback()

public static replaceCallback(string|array<string|int, string> $pattern, mixed $replacement, string $subject[, int $limit = -1 ][, int $flags = 0 ]) : ReplaceResult
Parameters
$pattern : string|array<string|int, string>
$replacement : mixed
$subject : string
$limit : int = -1
$flags : int = 0
Return values
ReplaceResult

replaceCallbackArray()

public static replaceCallbackArray(mixed $pattern, string $subject[, int $limit = -1 ][, int $flags = 0 ]) : ReplaceResult
Parameters
$pattern : mixed
$subject : string
$limit : int = -1
$flags : int = 0
Return values
ReplaceResult

replaceCallbackStrictGroups()

Variant of `replaceCallback()` which outputs non-null matches (or throws)

public static replaceCallbackStrictGroups(string $pattern, mixed $replacement, string $subject[, int $limit = -1 ][, int $flags = 0 ]) : ReplaceResult
Parameters
$pattern : string
$replacement : mixed
$subject : string
$limit : int = -1
$flags : int = 0
Return values
ReplaceResult

checkOffsetCapture()

private static checkOffsetCapture(int $flags, string $useFunctionName) : void
Parameters
$flags : int
$useFunctionName : string

checkSetOrder()

private static checkSetOrder(int $flags) : void
Parameters
$flags : int

        
On this page

Search results