protected function assertNoEval($pattern)
    {
        $pos = strrpos($pattern, $pattern[0]);
        $modifiers = substr($pattern, $pos + 1);
        
        if (strpos($modifiers, 'e') !== false) {
            throw new \Twig_Error_Runtime("Using the eval modifier for regular expressions is not allowed");
        }
    }