var strSource="1#2#3#4#5#35#121321#1313132.1.213.#31";
var strTemp="";
var reg=new RegExp("#","g");
var i=0;
var result=reg.exec(strSource);
while (result != null)
{
strTemp=strSource.substring(i,result.index);
document.writeln("Sub:"+strTemp+"<br>");
i=result.index+result[0].length;
result=reg.exec(strSource);
}
// write the last one
document.writeln("Sub:"+strSource.substring(i)+"<br>");