Carefull with $('#dialog li[class^="C"]')
! It will only match elements, whose class attribute starts with "C" not ones with a class starting with C. For example it will not match <li class="foo Clown">
.
AFAIK what you want is not possible mit jQuery alone. You would need to loop through the classes and check each separatly. Something like:
$('#dialog li').filter(function(){
var classes = this.className.split/\s/;
for (var i = 0, len = classes.length; i < len; i++)
if (/^C/.test(classes[i])) return true;
return false;
}).each( ... )
Alternativly you should consider changing your approach, and give all elements an additional class and filter by that. This has the addvantage that it can also be used in CSS:
<li class="Clown Clown-Funny">
<li class="Clown Clown-Sad">
<li class="Clown Clown-Rodeo">