Sorry, got a bit of formatting wrong. Messed up what I was really trying to point out. container_tag << Group(open_tag + OneOrMore(container_tag | content) # ^name ^recursive reference