фонарик,
<textarea id="text" style="display:block;width:400px; height:50px" name="" cols="" rows="">
Shape{
appearance Appearance{
maturial DEF Material #mat
Material{diffuseColor 1.0 1.0 1.0}
texture ImageTexture{url "txt4.tga" }}
geometry IndexedFaceSet{
creaseAngle 3.14
coord DEF sea08 Coordinate{
point[0 0 0]
}
coordIndex[
2,1,0,-1,2,0,3]
texCoord TextureCoordinate{
point[]
}
texCoordIndex[
2,1,0,-1,2,0,3,-1,2,3,4,]
}
}
Shape{
appearance Appearance{
material DEF Material - Default
Material{diffuseColor 1.0 1.0 1.0}
texture ImageTexture{url "dent5.tga" }}
geometry IndexedFaceSet{
creaseAngle 3.14
coord DEF sea08 Coordinate{
point[0 0 0]
}
coordIndex[
2,1,0,-1texCoord TextureCoordinate{
point[0 0]
}
texCoordIndex[
2,1,0,-1,2,0,3]
}
}
</textarea>
<input type="button" value="RegExp" onclick="RegExp_01()">
<script>
function RegExp_01(){
var raw_data = document.getElementById('text').value; //читаем текст из поля
var data_array = raw_data.split('Shape').slice(1);
alert(JSON.stringify(data_array));
}
</script>
Вариант без regexp.