preg_replace Remove comment text in content

The problem you are having with your code is this line:

$conten = preg_replace("/<!--REMOVE-->.*<!--ENDREMOVE-->/", '', $content);

$conten is assigned, but $content is returned.

function remove( $content ) {
    return preg_replace( '/<!--REMOVE-->.*<!--ENDREMOVE-->/', '', $content );
}

After question edit:

The real result from above code is

abc acb acb acb
abc acb acb acb

.* is greedy. It finds all matches up to the last <!--ENDREMOVE-->.

.*? is not greedy. It finds all matches up to the first <!--ENDREMOVE-->.

Use this function:

function remove( $content ) {
    return preg_replace( '/<!--REMOVE-->.*?<!--ENDREMOVE-->/', '', $content );
}