I want a expression that replaces more than 2 newlines and more than 4 spaces with 2 newlines / 1 space.

Now I have a working regex expression: "{5,}|^\n{2 ,}":

But now I have a problem: In PHP I have to say what I want it to replace with and as I have multiple replaces I have to have multiple preg_replaces.

Could anyone please make a preg_replace with the regex above and replace it with the statements...