Next / Previous / Contents / Shipman's homepage

5.19. NoMatch: A parser that never matches

pp.NoMatch()

This parser will always raise a pp.ParseException.

>>> fail = pp.Literal('Go') + pp.NoMatch()
>>> fail.parseString('Go')
pyparsing.ParseException: Unmatchable token (at char 2), (line:1, col:3)