code: function replace( str, regexp, replacement )
  	{
  		var headBookmark = '',
  			tailBookmark = '';
  
  		str = str.replace( /(^<span[^>]+data-cke-bookmark.*?\/span>)|(<span[^>]+data-cke-bookmark.*?\/span>$)/gi,
  			function( str, m1, m2 ){
  					m1 && ( headBookmark = m1 );
  					m2 && ( tailBookmark = m2 );
  				return '';
  			} );
  		return headBookmark + str.replace( regexp, replacement ) + tailBookmark;
  	}
docs: Wrapper function of String::replace without considering of head/tail bookmarks nodes.