PhpCss\Scanner\Status::matchPattern PHP Method

matchPattern() public method

Checks if the given offset position matches the pattern.
public matchPattern ( string $buffer, integer $offset, string $pattern ) : string | null
$buffer string
$offset integer
$pattern string
return string | null
    public function matchPattern($buffer, $offset, $pattern)
    {
        $found = preg_match($pattern, $buffer, $match, PREG_OFFSET_CAPTURE, $offset);
        if ($found && isset($match[0]) && isset($match[0][1]) && $match[0][1] === $offset) {
            return $match[0][0];
        }
        return NULL;
    }