Prefix anchors

start

The start method adds start anchor. Matches the position before the first character in a context. It ensures that the specified pattern occurs right at the start of a line.

use Rudashi\Regex;
 
$pattern = Regex::build()->start();
 
// /^/

startOfLine

The startOfLine method is equivalent to the start method.

use Rudashi\Regex;
 
$pattern = Regex::build()->startOfLine();
 
// /^/
Fluent Regex
rudashi · © 2024 All rights reserved