Phlexy\Lexer\Stateless\Simple::__construct PHP Method

__construct() public method

public __construct ( array $regexToToken, $additionalModifiers = 'i' )
$regexToToken array
    public function __construct(array $regexToToken, $additionalModifiers = 'i')
    {
        $this->regexToToken = array();
        foreach ($regexToToken as $regex => $token) {
            $regex = '~' . str_replace('~', '\\~', $regex) . '~A' . $additionalModifiers;
            $this->regexToToken[$regex] = $token;
        }
    }