Next / Previous / Contents / TCC Help System / NM Tech homepage

5.34. White: Match whitespace

pp.White(ws=' \t\r\n', min=1, max=0, exact=0)

An instance of this class matches one or more characters of whitespace.


This string argument defines which characters are considered whitespace.


This argument defines the minimum number of characters that are required for a match.


This argument defines the maximum number of characters that will be matched.


If specified, this number defines the exact number of whitespaces characters that will be matched.

>>> text = '   '
>>> print pp.White().parseString(text)
['   ']
>>> print pp.White(exact=1).parseString(text)
[' ']
>>> print pp.White(max=2).parseString(text)
['  ']