Next / Previous / Contents / Shipman's homepage

7.4. cStyleComment: Match a C-language comment

The variable pp.cStyleComment is a parser that matches comments in the C language.

>>> print pp.cStyleComment.parseString('''/* First line.
...    Second line.
...    Third line. */''')
['/* First line.\n   Second line.\n   Third line. */']