Try this first in replacements:

ur'(?m)^== *([a-zA-Z ]+) *==\n+ etc.
m for multiline (sometimes ?s works instead, I just use it without understanding why), and space* in case there are spaces between == marks.

--
Bináris