$('div[id^="start_with"] and not [id$="end_with"]').each(function () {
//TO DO
});
How to combine multiple selectors, if some of them is NOT?
Use :not() immediately(without any spaces) following the first attribute condition
$('div[id^="start_with"]:not([id$="end_with"])').each(function () {
//TO DO
});