Next / Previous / Contents / Shipman's homepage

7.8. dblSlashComment: Parser for a comment that starts with “//

The variable pp.dblSlashComment is a parser that matches comments in C++ or Java programs that start with “//” and extend to the end of the line.

>>> text = '// Comment\nNext line'
>>> print pp.dblSlashComment.parseString(text)
['// Comment']