I'm writing a parser for some marked-up data,开发者_如何学Go and I'd like to get pyparsing to discard things like start and end tags in the final result, leaving just the data.
Can I do this, or do I just have to name the value appropriately and pull them out manually?
"Suppress" is probably what you want. You can use the Suppress class explicitly, as in dont_care = Suppress(Word(alphas))
or call suppress() on any expression, dont_care = Word(alphas).suppress()
. This will suppress the matched tokens from appearing in the parsed output.
精彩评论