Next / Previous / Contents / Shipman's homepage

5.33. Upcase: Uppercase the result

pp.Upcase(p)

An instance of this class matches what parser p matches, but when the matching text is deposited in the returned ParseResults instance, all lowercase characters are converted to uppercase.

>>> name = pp.Upcase(pp.Word(pp.alphas))
>>> print name.parseString('ConfuseACat')
['CONFUSEACAT']