earwig / mwparserfromhell

A Python parser for MediaWiki wikicode
https://mwparserfromhell.readthedocs.io/
MIT License
741 stars 74 forks source link

Possible to strip_code() and keep the templates? #280

Closed kilgarenone closed 2 years ago

kilgarenone commented 2 years ago

Say I have a section with this text: and positive reviews.{{Citation needed|date=December 2007}} The.

Then I strip_code() it so I can do a regex re.search() on the resultant string.

Things is, in my regex, I need to match for the template too {{Citation needed|date=December 2007}}.

Is there a way to do that?

kilgarenone commented 2 years ago

ok didn't know i can do section.__str__(). awesome. thanks!