<?php preg_match( string $pattern, string $subject, array &$matches = null, int $flags = 0, int $offset = 0): int|false
<?php #echo bin2hex($buf) . "\n"; $matches = []; preg_match('/^\033\[(\d+);(\d+)R$/', $buf, $matches); return [ intval($matches[2]),