Boomerml,
var str = '(#24174#||#22301#||#22298#||#22303#) && #14827# && #14543#'
reg = /[^#]+\(.*?\)|\(.*?\)[^#]+/
str = str.replace(reg,'');
alert(str);
str = '#144357# && #14827# && (#24174#||#22301#||#22298#)';
str = str.replace(reg,'');
alert(str);