Skip to content

Kirby 5.2.1

Tokenizer::match()

Matches a regex pattern at the current position in the query string. The matched lexeme will be stored in the $lexeme variable.

Tokenizer::match() has been marked as unstable. It might be changed in a future Kirby major or minor release without being considered a breaking change. Use with caution.

Tokenizer::match(string $query, int $offset, string $regex, bool $caseInsensitive = false): string|null

Parameters

Name Type Default Description
$queryrequired string no default value
$offsetrequired int no default value Current position in the query string
$regexrequired string no default value Regex pattern without delimiters/flags
$caseInsensitive bool false

Return types

stringornull

Parent class

Kirby\Query\Parser\Tokenizer