You were almost there. The only problem in your code is that you do not pass a valid regular expression pattern, it should be surrounded by /
s
<?php
function remove_url_size( $content ) {
$content =
preg_replace('/_n[^>]*.jpg/', '_n.jpg', $content);
return $content;
}
add_filter( 'the_content', 'remove_url_size' );
?>