I would like to get rid of extra lines before a paragraph using regular expressions in multiline mode. However, the following results in blank lines being detected twice in a loop:
^\s*
The results can be seen here. Why is the last blank line before the text not a part of the match? It is the reason the duplicate match occurs.