The regex implementations I have seen will assume default from
= zero, so :
(тема \d{0,2}).*(тема \d{0,2})
However, as @Lupp indicated, Writer does not perform matching across paragraph boundary, so the pattern will never match a heading + body + heading sequence (which will cross at least two paragraph boundaries, probably more).
Also, if the leading ТЕМА is not explicitly typed into the heading, but rather part of the numbering scheme, it is not detected by find/replace.
It may be possible to offer better help if you
- supply a sample document, not just a picture of the document
A copy of your document, with only a page or two, should suffice.
- tell us why. What is it you are trying to do? Why do you need that particular match?