I managed to match the newlines, but I can't remove empty lines. I even tried matching more than one line in a go (with something simmilar to: [^\n][\n]+[^\n]) but I wasn't able to get rid of those empty lines, although that might be the way to do it (in this situation those chars that match [^\n] have to be put back into the text).
The simplest solution would be to match
|
Source code
|
1
|
^\n$
|
or even
|
Source code
|
1
|
^$
|
but that won't work