I’m writing a parser for some marked-up data, 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.