<div id="Text" style="display:none; ">
[ "sarleon_recruit", "Sarleon Recruit", "Sarleon Recruits", tf_guarantee_boots|tf_guarantee_armor, 0, 0, fac_neutral,
[ itm_ankle_boots, itm_leather_jacket, itm_linen_tunic, itm_leather_vest, itm_cudgel, itm_warhammer, itm_military_pick, itm_sickle, itm_dagger,],
strength(5)|agility(5)|intellect(4)|charisma(4)|level(1), wp_one_handed(50)|wp_two_handed(50)|wp_polearm(50)|wp_archery(20)|wp_crossbow(20)|wp_throwing(20), knows_trade_2|knows_prisoner_management_1|knows_inventory_management_2|knows_shield_1|knows_weapon_master_1|knows_power_throw_1|knows_ironflesh_1,
0x0000000000000001124000000020000000000000001c00800000000000000000, 0x00000000000062c76ddcdf7feefbffff00000000001efdbc0000000000000000, 0,
52 ]
</div>
<div id="sarleon_recruit" onclick="arraysFind(this.id)" style="cursor:pointer;border:1px solid red; width:30px; height:30px; position:absolute; left: 40px; top: 20px; z-index:555; background-color:blue;"></div>
<script>
function arraysFind (BUM) {
function replac (arr) {
arr=arr.join(',').replace(/^\s*|\s*$/,'').split(/\s*?,\s*/g);
arr=('"'+arr.join('","')+'"').split(/,/g);
return arr
}
var Out =[];
var str = document.getElementById('Text').innerHTML; //Это строка - аналог получения нужной строки
var valid = str.indexOf(BUM);
if(valid==-1) return false;
str = str.substring(valid);//alert('>'+str)
var arr1=str.split(/\[|\]/img)[1].split(",");arr1.pop();
arr1 = replac(arr1);
Out.push(arr1);//Массив в квадратных скобках за BUM;
var arr2=str.split(/0x000/img)[0].split(/(strength)/img);arr2.splice(0,1);
arr2 = arr2.join('').split(/knows_/)[0].split(/[,|]/img);arr2.pop();
arr2 = replac(arr2);
Out.push(arr2); //Массив от strength до "knows_";
var arr3=str.split(/0x000/img)[0].split(/(knows_.*?)[|,]/img);arr3.splice(0,1);
arr3=arr3.join(',').split(/,+/img);arr3.pop();
arr3 = replac(arr3);
Out.push(arr3); //Массив с "knows_";
alert(arr1)
alert(arr2)
alert(arr3)
return Out;
}
</script>