Lexer for regular expression of perl