For more elaborate filters than "starts with" you can use the filter() function:
$('#dialog li').filter( function() {
// return true for every element that matches your condition
return this.className.match(/^c/) != null;
}).each(function(){
//do something
}