class Char(Regex): def __init__(self, c): Regex.__init__(self, False) self.c = c def _shift(self, c, mark): return mark and c == self.c