Lines Matching refs:offset
99 * Attempt to match a regex in string s at offset offset
107 public static function matchAt(string $regex, string $string, int $offset = 0): ?int
110 $string = \mb_substr($string, $offset, null, 'UTF-8');
115 // PREG_OFFSET_CAPTURE always returns the byte offset, not the char offset, which is annoying
118 return $offset + $charPos;
130 public static function matchFirst(string $pattern, string $subject, int $offset = 0): ?array
132 if ($offset !== 0) {
133 $subject = \substr($subject, $offset);