just try, not tested before
<textarea id="test">
111[
222[ ]
333[
]
444[
]a[
]
555[
666[ ]
777[
]
888[]
]
]
111[
222[ ]
333[
]
444[
]a[
]
555[
666[ ]
777[
]
888[]
]
]
</textarea>
<script>
function g(s){
var arr=[],i=0;
var re = /111\[([\s\S]*?)\]/
while (re.test(s)) {
arr[i++] = RegExp.$1;
s = s.replace(re, "");
}
return arr;
}
document.write(g(test.value).join("<br/>");
</script>
</script>