I am trying to create a form of dictionary parser. In a text file, I have text in the following format:

```
<topic>some_title1:<start>
test_text<end>

<topic>title_2:<start>
test1
test2<end>

```

In each case, `<topic>` denotes a key, and the text between `<start>` and `<end>` is the value. The key is always a single line, whereas the value may (and most likely will) be more than one line.

My regex is as follows:

```
p = re.compile("<topic>(.+):<start>\n(.+)<end>")

```

I am using `p.findall(data)` to get the key/value pairs.

Without `re.DOTALL`, I only get one match, which is the first (`some_title1` with a value of `test_text`). However, I need both matches.

So, I tried using `re.DOTALL`.

This, on the other hand, also gives one match, but not correctly:

`some_title1:<start>\ntest_text<end>\n\n<topic>title_2` with a corresponding value of `test1\ntest2`.

How can I fix this? I (hopefully) want to maintain the tag-like structure.