CHAR_CLASS = \[^?\]?-?([^]-]-[^]-]|[^]-])+-?\]|\[^?(-|\]|\]-)\] #All the escape sequences TAB = \\t NEWLINE = \\n CARRIAGE_RETURN = \\r BACKSPACE = \\b SPACE = \\s|\s BELL = \\a FORMFEED = \\f VTAB = \\v BACKSLASH = \\\\ ESCAPED_STAR = \\\* ESCAPED_PLUS = \\\+ ESCAPED_PIPE = \\\| ESCAPED_LPAREN = \\\( ESCAPED_RPAREN = \\\) ESCAPED_LBRACKET = \\\[ ESCAPED_RBRACKET = \\\] ESCAPED_QUESTIONMARK = \\\? ESCAPED_DOT = \\\. # The special chars DOT = \. STAR = \* PLUS = \+ QUESTIONMARK = \? PIPE = \| LPAREN = \( RPAREN = \) # Anything other than these is valid # It cannot be ] or [, since those should be handled by CHAR_CLASS # If it is a \, it is an invalid escape sequence CHAR = [^][\] ERROR = .