src/Behat/Gherkin/Lexer.php
protected function scanInput($regex, $type)
    {
        if (!preg_match($regex, $this->line, $matches)) {
            return null;
        }

        $token = $this->takeToken($type, $matches[1]);
        $this->consumeLine();

        return $token;
    }
protected function scanInput($regex, $type)
    {
        if (!preg_match($regex, $this->line, $matches)) {
            return null;
        }

        $token = $this->takeToken($type, $matches[1]);
        $this->consumeLine();

        return $token;
    }
protected function scanInput ( $ regex , $ type ) { if ( ! preg_match ( $ regex , $ this -> line , $ matches ) ) { return null ; } $ token = $ this -> takeToken ( $ type , $ matches [ 1 ] ) ; $ this -> consumeLine ( ) ; return $ token ; }
Scans for token with specified regex.

@param string $regex Regular expression
@param string $type  Expected token type

@return null|array
Scans for token with specified regex .