var b1=a1.split(/\s\d{2}\.\d{2}\.\d{2}\s\d{2}\:\d{2}\s.+\sПравка\sip\sinf/); for(var i = 0; i < b1.length; i++) { if(!b[i].replace(/\s/g, "")) { b1.splice(i, 1); i--; } }