$(".rpl").each(function(){ var reg = /(\d)\s/ var x = $(this).text() $(this).text(x.replace(reg,"$1")) })