I wish to parse configuration files like apache2.conf, which appears like this:
<Group group1> param1 1 <SomeGroup group3> param3 3 </SomeGroup> </Group> <Group group2> param2 2 </Group>
re.findall(r'\</?[^\>]+\>([\s\S]+)\<//?[^\>]+\>', text, re.MULTILINE)
basically use lazy regexp, it cuts such as this:
<Group group1> param1 1 <SomeGroup group3> param3 3 </SomeGroup>
Basically use greedy regexp, it cuts all of the text. So, what's the right way to parse it? Or perhaps is there any libraries?