This regex follows your outlined specifications:
String regex = "\\s*[{}]\\s*|\\s*\\}\\s*else.*";
It matches lines containing either:
0
or more spaces, followed by{
or}
, followed by 0 or more spacesor
0
or more spaces, followed by a}
, then0
or more spaces, thenelse
, then anything.