private function getWhitespaceLength(string $input, int $pos): int
    {
        if ($this->regexpWhitespace) {
            if (
                false === preg_match(
                    $this->regexpWhitespace,
                    $input,
                    $match,
                    0,
                    $pos
                )
            ) {
                $error_code = preg_last_error();
                throw new \RuntimeException(
                    "PCRE error #$error_code for whitespace at input pos $pos"
                    . '; REGEXP = ' . $this->regexpWhitespace,
                    $error_code
                );
            }

            if ($match) {
                return strlen($match[0]);
            }
        }

        return 0;
    }
private function getWhitespaceLength(string $input, int $pos): int
    {
        if ($this->regexpWhitespace) {
            if (
                false === preg_match(
                    $this->regexpWhitespace,
                    $input,
                    $match,
                    0,
                    $pos
                )
            ) {
                $error_code = preg_last_error();
                throw new \RuntimeException(
                    "PCRE error #$error_code for whitespace at input pos $pos"
                    . '; REGEXP = ' . $this->regexpWhitespace,
                    $error_code
                );
            }

            if ($match) {
                return strlen($match[0]);
            }
        }

        return 0;
    }
private function getWhitespaceLength ( string $ input , int $ pos ) : int { if ( $ this -> regexpWhitespace ) { if ( false === preg_match ( $ this -> regexpWhitespace , $ input , $ match , 0 , $ pos ) ) { $ error_code = preg_last_error ( ) ; throw new \ RuntimeException ( "PCRE error #$error_code for whitespace at input pos $pos" . '; REGEXP = ' . $ this -> regexpWhitespace , $ error_code ) ; } if ( $ match ) { return strlen ( $ match [ 0 ] ) ; } } return 0 ; }
Search a presens of whitespaces in input text in a position

Search is performed by `parse()` after `compile()` call. Match is searched
exactly in the given position by `\G`.
@param string $input Input text to search where
@param int $pos Position inthe text to match where
@return int Returns matched length of whitespaces. Returns 0 if no whitespaces
found in the position.
Search a presens of whitespaces in input text in a position