var reg_exp=/(\d+)/; var a = "111private".match(reg_exp); var b = "35private".match(reg_exp); if( (a)&& (b) && ( parseInt(a[1]) > parseInt(b[1]) ) ) {alert("ok");}