$("a.lengtht").each(function(){ if ($(this).text().length > 22) {$(this).text($(this).text().substr(0, 19));$(this).append('...'); } });$(".a1view").each(function(){$(this).html(parseInt($(this).text().replace(/^[\s\S]*-\s+(\d+)\s+[\s\S]*$/m, '$1')));});