Mmkay, well here is a generator solution that seems to work well for me. You can also provide various public and private tags if you wish.
def get_tags(s, open_delim ='{{', close_delim ='}}' ): while True:
Run against your target input as follows:
# prints: today, runner_up, blabla, oooo for tag in get_tags(html): print tag
Edit: it also works against your new example :). In my explicit quick test, it also seemed to handle the wrong tags in a reasonable way, although I cannot guarantee its reliability!
source share